Send Email from different email accounts
When I send emails they go out from my personal inbox at work, but I need them to go out from another mailbox that I have access to. I have both mailboxes in my outlook.
Can I send emails from a specific mailbox?
Here is the code I am using. It does not find the 2nd item in my account.
Sub Mail_small_Text_Change_Account() Dim cel As Range Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim strbody As String Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" On Error Resume Next For Each cel In Range(("C2"), Range("C2").End(xlDown)) With OutMail .To = cel.Value '.CC = cel.Offset(0, 3).Value .Subject = "Benefits Refund" .Body = strbody .SendUsingAccount = OutApp.Session.Accounts.Item(2) .Send 'or use .Display End With Next On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub
Yes. Using a POP mail box, you can specify the user name and password for any account.
.To = "E@E.com" .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = "This is the body" .SendUsingAccount = OutApp.Session.Accounts.Item(1)