#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Email .From

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 = " 'This line gives error
.To = "
.deferreddeliverytime = Range("DeliveryTime")
.Subject = "Rates Update "
.readreceiptrequested = True
.attachments.Add Template.FullName
.display
.send
End With
End Function

Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email .From

Hi Cavy

See the tips page
http://www.rondebruin.nl/mail/tips2.htm

Change sender name and reply address

If you want to change the sender name and reply address add this code line

'The receiver can see the original mail address in the properties if he want
..SentOnBehalfOfName = """SenderName"" "





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Cavy" wrote in message ...
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 = " 'This line gives error
.To = "
.deferreddeliverytime = Range("DeliveryTime")
.Subject = "Rates Update "
.readreceiptrequested = True
.attachments.Add Template.FullName
.display
.send
End With
End Function

Thanks!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Email .From

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.


"Ron de Bruin" wrote:

Hi Cavy

See the tips page
http://www.rondebruin.nl/mail/tips2.htm

Change sender name and reply address

If you want to change the sender name and reply address add this code line

'The receiver can see the original mail address in the properties if he want
..SentOnBehalfOfName = """SenderName"" "





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Cavy" wrote in message ...
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 = " 'This line gives error
.To = "
.deferreddeliverytime = Range("DeliveryTime")
.Subject = "Rates Update "
.readreceiptrequested = True
.attachments.Add Template.FullName
.display
.send
End With
End Function

Thanks!!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email .From

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Cavy" wrote in message ...
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.


"Ron de Bruin" wrote:

Hi Cavy

See the tips page
http://www.rondebruin.nl/mail/tips2.htm

Change sender name and reply address

If you want to change the sender name and reply address add this code line

'The receiver can see the original mail address in the properties if he want
..SentOnBehalfOfName = """SenderName"" "





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Cavy" wrote in message ...
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 = " 'This line gives error
.To = "
.deferreddeliverytime = Range("DeliveryTime")
.Subject = "Rates Update "
.readreceiptrequested = True
.attachments.Add Template.FullName
.display
.send
End With
End Function

Thanks!!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
can I copy a column of email addresses, paste into email address? Lizizfree New Users to Excel 4 July 20th 06 10:03 PM
Transfer Email addresses from spreadsheet to email address book Beana Excel Discussion (Misc queries) 2 May 30th 06 06:07 PM
Email editor closes when forwarding Excel-embedded email Bambina Setting up and Configuration of Excel 0 March 16th 06 10:45 PM


All times are GMT +1. The time now is 11:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"