Declare an Outllook variable from access vba

W

Wayne-I-M

Hi

We have multiple accounts for e mails.
abc@XYZ
def@XYZ
ghi@XYZ
etc.

Is there a way to declare a variable in vba to specify the e mail account to
send a mail from.

So, if we send a report to My Smith I want it to go from e mail account
"abc" and if I send a report to Mr Jones I want tit to go from account "DEF".

Any ideas, or is this an Outlook question ?

Many thanks
 
A

aaron.kempf

I can specify different profiles for the FROM address in SQL Server

sp_send_dbmail I think that it's called in sql2005+
or
xp_sendmail in sql 2000, but i don't think that it supports multiple
profiles as easily

-aaron
 
T

Tony Toews [MVP]

Is there a way to declare a variable in vba to specify the e mail account to
send a mail from.

olItem.SentOnBehalfOfName = "(e-mail address removed)"

I do believe that account may somehow have to give permission for the
current Outlook profile to send the email but I sure could be wrong
about that.

Please ignore Aaron Kempf's posting as his answer to every question
requires SQL Server.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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