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!!
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!!