Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Sending e-mails from specific email address
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="daniel.bonallack, post: 7426490"] I am preparing code that sends e-mails via Outlook, but gets the data it needs from an Excel spreadsheet. It loops through rows in Excel to get the fields it needs. The code to send e-mails is below. However, I want the e-mail to be sent from a separate account that I have access to. Currently, it always sends from [email]daniel.xxx@xyz.com[/email] (my default). But I want to send from [email]generic@xyz.com[/email] (another account I can access via Outlook) Any help appreciated. Daniel ____ Sub SendEmails() Dim OutApp As Object Dim OutMail As Object Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) mySalutation = "Dear " & Cells(iEmail, 2).Value & "," On Error Resume Next With OutMail .To = Cells(iEmail, 5).Value .CC = "" .BCC = "" .Subject = cells(iMail, 6).value .Body = mySalutation & Chr(10) & Chr(10) & myBody .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Sending e-mails from specific email address
Top