ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send Mail Q (https://www.excelbanter.com/excel-programming/422918-send-mail-q.html)

Seanie

Send Mail Q
 
I use Send Mail to e-mail various Excel reports with Ron de Bruins
excellent codes, but how can I send using an alias I have setup i.e
not the account I have set as my Outlook address & name

For eg. say if I want to send with:-
e-mail address =
Name = Company Scores

I know there is a way I just can't seem to find it

Using Office 2007

Mike

Send Mail Q
 
Seanie,

I did this to pull values for the alias from cells in the workbook with
likely similar code:

With iMsg
Set .Configuration = iConf
.To = ActiveSheet.Range("X32")
.CC = ""
.BCC = ""
.From = "" + ActiveSheet.Range("X35")
.Subject = ActiveSheet.Range("X34")
.TextBody = strbody
.AddAttachment TempFilePath & TempFileName & FileExtStr
' Request read receipt
.Fields("urn:schemas:mailheader:return-receipt-to") =
ActiveSheet.Range("X35")
.Fields("urn:schemas:mailheader:disposition-notification-to") =
ActiveSheet.Range("X35")
' Update fields
.Fields.Update
.Send
End With





"Seanie" wrote:

I use Send Mail to e-mail various Excel reports with Ron de Bruins
excellent codes, but how can I send using an alias I have setup i.e
not the account I have set as my Outlook address & name

For eg. say if I want to send with:-
e-mail address =
Name = Company Scores

I know there is a way I just can't seem to find it

Using Office 2007


Mike

Send Mail Q
 
That may have been a little vague (my last post)

Try changing the ".From" line to:

..From = "company scores "

Mike



"Seanie" wrote:

I use Send Mail to e-mail various Excel reports with Ron de Bruins
excellent codes, but how can I send using an alias I have setup i.e
not the account I have set as my Outlook address & name

For eg. say if I want to send with:-
e-mail address =
Name = Company Scores

I know there is a way I just can't seem to find it

Using Office 2007


Ron de Bruin

Send Mail Q
 
Use this is you use my Outlook object model examples

.SentOnBehalfOfName = """SenderName"" "



--

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


"Seanie" wrote in message ...
I use Send Mail to e-mail various Excel reports with Ron de Bruins
excellent codes, but how can I send using an alias I have setup i.e
not the account I have set as my Outlook address & name

For eg. say if I want to send with:-
e-mail address =
Name = Company Scores

I know there is a way I just can't seem to find it

Using Office 2007


Seanie

Send Mail Q
 
When I add the line .SentOnBehalfOfName = """SenderName""
"

The From: line on the actual mail sent displays as:-

Joe Bloggs ]; on behalf of; Company Scores
]

What I wanted to achieve is for the From line just to contain:-

Company Scores ]

Is this possible i.e. drop the "sent on behalk of"?


Seanie

Send Mail Q
 
I probably should have expressed this differently. I have 2 accounts
set up in Outlook, is it possible via the Send Mail macro to select
the a/c which send out the mail? (other that using the sendonbehalfof
command above)


Ron de Bruin

Send Mail Q
 
It is possible but not easy I believe
I am working on it now for another person so If I know more I post it here

--

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


"Seanie" wrote in message ...
When I add the line .SentOnBehalfOfName = """SenderName""
"

The From: line on the actual mail sent displays as:-

Joe Bloggs ]; on behalf of; Company Scores
]

What I wanted to achieve is for the From line just to contain:-

Company Scores ]

Is this possible i.e. drop the "sent on behalk of"?


Seanie

Send Mail Q
 
Thanks for your help Ron, I thought Excel 2007 had that feature, but
obviously I was wrong


Ron de Bruin

Send Mail Q
 
I am working on new examples now

In 2007 we can use SendUsingAccount



--

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


"Seanie" wrote in message ...
Thanks for your help Ron, I thought Excel 2007 had that feature, but
obviously I was wrong


Ron de Bruin

Send Mail Q
 
Try this new page

Use the Account you want in mail macro in Excel/Outlook 2007
http://www.rondebruin.nl/mail/account.htm




--

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


"Seanie" wrote in message ...
I use Send Mail to e-mail various Excel reports with Ron de Bruins
excellent codes, but how can I send using an alias I have setup i.e
not the account I have set as my Outlook address & name

For eg. say if I want to send with:-
e-mail address =
Name = Company Scores

I know there is a way I just can't seem to find it

Using Office 2007


Seanie

Send Mail Q
 
Ron, worked like a dream


Seanie

Send Mail Q
 
Ron, the only thing I spotted is that in the recipients e-mail the To:
box shows the Outlook e-mail A/c I used to send the mail, although it
does get to the recipient. Is that normal in Outlook, or just your
code?


Ron de Bruin

Send Mail Q
 
hi Seanie

I see the name I type in the "Your Name" textbox in the properties of the account


--

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


"Seanie" wrote in message ...
Ron, the only thing I spotted is that in the recipients e-mail the To:
box shows the Outlook e-mail A/c I used to send the mail, although it
does get to the recipient. Is that normal in Outlook, or just your
code?



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com