email from excel - change sender?

T

Taliesin

I'm using this function to send an email from excel, is their any way to
change the From details so that I can use the department e-mail rather than
my personal one?

Function SendIt(FromEmail, ToEmail, ToCC, ToBCC, ToSubject, ToBody,
ToAttachment)
Set out = CreateObject("Outlook.Application")
Set mapi = out.GetNameSpace("MAPI")
Set email = out.CreateItem(0)
email.Recipients.Add (ToEmail)
email.Subject = ToSubject
email.Body = ToBody
email.Send
Set outlook = Nothing
Set mapi = Nothing
End Function
 

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