Email .From

C

Cavy

Hi there,

I have a working routine to send out specific emails with attachments.
How can i define the .from property of the email?

Here is my code:

Function SendEmail()
Dim myOutlook As Object
Dim MymailItem As Object
Set otlApp = CreateObject("outlook.application")
Set otlNewMail = otlApp.createitem(olmailitem)
Set Template = ActiveWorkbook

ThisWorkbook.Activate

With otlNewMail
'.from = "(e-mail address removed)" 'This line gives error
.To = "(e-mail address removed)"
.deferreddeliverytime = Range("DeliveryTime")
.Subject = "Rates Update "
.readreceiptrequested = True
.attachments.Add Template.FullName
.display
.send
End With
End Function

Thanks!!
 
C

Cavy

Hi Ron de Bruin,

Thank you very much for your reply. It works great!

I thought it would be ok if I write that I admire you very much, and within
the excel community you are one of my heroes.
 
R

Ron de Bruin

Hi Cavy
I thought it would be ok if I write that I admire you very much, and within
the excel community you are one of my heroes.

You are welcome
Thanks for the nice words
 

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