Hi,
First time poster. I have a little application that send an e-mail from the users account to a specified e-mail address (lots of help on the forums on To and Body etc). This has all been very easy, until it was requested to have the "From" field populated. The department wants the replies to go to a central address. Current code, but it falls over at .From.
Sub SimpleMail() Set olApp = CreateObject("Outlook.application") Set m = olApp.CreateItem(olMailItem) With m .Subject = Sheets("Master").[H4].Value .To = "email1@domain.com" .Body = ActiveSheet.Range("C7").Text & vbCrLft .From = "email3@domain.com" .Send End With End Sub
Last edited by Saffa; 06-14-2010 at 08:06 AM. Reason: add code tags for newbie PM warning
Try:
.SentOnBehalfOfName = "email3@domain.com"
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Works perfectly, thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks