VBScript Sendmail not selecting correct 'from' address

Status
Not open for further replies.

Roy Glixon

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
I have 2 MS-Microsoft Accounts and one internal account, which stores my public folders(PF). Inside the PF, I have a MS-Outlook system which includes a sendmail feature. When sending mail, the 'from' address is defaulted to the wrong MS-Microsoft account. I would like to default to the other one. Help on this topic was focused on VBA and not VBScript. I have played with 'default' account (mail icon in windows) and with any AD deifnitions with my name. None seem to affect the 'from' address. I would like for this to work with other users, so a hard-coded solution in my code doesn't make send.

roy

Roy Eliot Glixon
Ashton, Maryland
 

Roy Glixon

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Thanks for asking.

snippits follow

Dim MyItem

Set MyItem = Application.CreateItem(0) ' creates native Mail form

MyItem.To = strTo ' passed argument

MyItem.To.ResolveAll

if (strCC <> "") then
MyItem.cc = strCC

MyItem.cc.ResolveAll
End if

MyItem.Subject = strDo & " Ticket: "&MakeTaskLine()


<stuff>


strBody = strBody & "</p></font></body></html>"

MyItem.HTMLBody = strBody


<stuff>


If strDo = "PRINT: " Then

MyItem.Printout

Else

MyItem.Display ' HelpDesk technician must hit send to finalize
End if

<user presses send when done>
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
You need to set the SendUsingAccount property to the account you want to send from. All available accounts are listed in Session.Accounts
 
Status
Not open for further replies.
Top