How do I change email address of sender when I mail out of word?

S

Sam4X5

When I mail out of Word to a mail recepient one of the email addresses on my ISP list of email addresses appears next to my name and is read by the recepient. I want another email address on my ISP list to appear next to my name when mailing documents out of Word. How can I make this switch?
 
D

Doug Robbins - Word MVP

This was posted recently

Quote
I did some investigating and discovered a .NET method (framework 1.1) that
bypasses Outlook altogether, as long as you can know the address of your
SMTP server. Takes one reference and two lines of code. Sweet.

'First add a reference to System.Web

System.Web.Mail.SmtpMail.SmtpServer = "SMTP Server Name"

System.Web.Mail.SmtpMail.Send(from:="(e-mail address removed)",
to:="(e-mail address removed)", subject:="Test", messagetext:="This be the
body.")

Steve



Steve Lang said:
hi Brian,

Creating a VB application or - even better - customizing Word to do this
(notwithstanding the possible caveat noted below) is relatively simple.
Create a reference to the Outlook object model and add some code of this
nature:

Set myOutlook = CreateObject("Outlook.Application")
Set myNameSpace = myOutlook.GetNamespace("MAPI")
Set myItem = myOutlook.CreateItem(olMailItem)
With myItem
.To = strTo 'this would be your judge e-mail address
.Subject = strDocName 'the name of the file to attach
.Body = strMsg 'whatever you want it to be
.Attachments.Add strDocPath & strDocName 'the full name and path
to the document
.Send
End With
Set myOutlook = Nothing
Set myNameSpace = Nothing
Set myItem = Nothing

The watching aspect can be handled with a timer control and a directory
reference in VB or you could have the e-mail automatically be sent when the
document is closed. Then when the Outlook warning appears, you would just
need to click "Yes" when you are closing the file.


***CAVEAT***
AFAIK, each time an outside application touches Outlook to generate an
e-mail, the user needs to authenticate that action to be a valid one. This
was put into effect to reduce the ability of worms and viruses to propagate
themselves silently through a user's address book. I don't believe this can
be worked around.

HTH and have a great day!

Steve
--
Stephen Lang
Legislative Counsel Bureau
Carson City, NV
GMT+8
slang at lcb <dot> state <dot> nv <dot> us


Unquote
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Sam4X5 said:
When I mail out of Word to a mail recepient one of the email addresses on
my ISP list of email addresses appears next to my name and is read by the
recepient. I want another email address on my ISP list to appear next to my
name when mailing documents out of Word. How can I make this switch?
 

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