#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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"?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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"?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default Send Mail Q

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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default Send Mail Q

Ron, worked like a dream

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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?

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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?

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
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Not able to send Mail - Ron de SANDIND Excel Programming 2 June 1st 08 12:35 PM
A program is trying to send mail using Item.Send David Gerstman Excel Programming 4 December 5th 06 06:31 PM
Send e-mail with CDO Luciano Excel Programming 0 January 12th 05 09:15 AM
Send Mail janet Excel Programming 2 July 22nd 03 10:06 PM


All times are GMT +1. The time now is 05:22 PM.

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

About Us

"It's about Microsoft Excel"