Enter email in 'From box' when sending mail via excel

S

Sjaakve

Hi,

i'm trying to write a macro to send an email. De code to do this can
be found throughout the web. However it is not specified how to enter
an adress in the 'From' field.

In my email i have the rights to multiple email account and inboxes.
Ik would like to send an email from one specific email adress.

Is this possible???

The code i've tried is shown below.


___________________________________________________________

Sub Mail_Uit(Van As String, Naar As String, Carbon As String,
Onderwerp As String)

'Application.DisplayAlerts = False
'Application.ScreenUpdating = False

'Variable declaration
Dim oApp As Object
Dim oMail As Object

' Create and show the outlook mail item
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(0)
With oMail
.From = Van ' THIS LINE DOES NOT WORK
.To = Naar
.CC = Carbon
.Subject = "Test email van correspondentieregister"
'.Attachments.Add
.Display
End With

' Restore screen updating and release Outlook
'Application.ScreenUpdating = True
Set oMail = Nothing
Set oApp = Nothing
'Application.DisplayAlerts = True

End Sub

________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top