Stridhan
Well-known Member
- Joined
- Mar 5, 2014
- Messages
- 568
Hi
Got a urgent problem which I can't solve and haven't seen any solution in here.
Got different accounts in outlook and want to send some mails from a specific account through vba but it simply wont work.
I've tried .sendas , .senderemailaddress but the sender stays as default sender all the time..
Anyone got any idea what Im doing wrong here?
Below is what im currently testing..
Got a urgent problem which I can't solve and haven't seen any solution in here.
Got different accounts in outlook and want to send some mails from a specific account through vba but it simply wont work.
I've tried .sendas , .senderemailaddress but the sender stays as default sender all the time..
Anyone got any idea what Im doing wrong here?
Below is what im currently testing..
Code:
For Each oAccount In OutApp.session.accounts
If oAccount = "xxx" Then
With OutMail
.sendas = oAccount
.TO = Kundmail
.BCC = ""
.Subject = "xxx"
.HTMLBody = Mymessage
'.display
.Send
End With
On Error GoTo 0
GoTo Nextone
End If
Next oAccount