vbscript - VB Script to change the from field of emails in Outbox -


i have emails in outbox in outlook , i'd run vb script change field of these emails other email

i managed following doesn't work i'd , therefore missing main piece. i'd appreciate if help.

intfolderoutbox = 4 msofiledialogopen = 1  ' load requied objects set wshshell = wscript.createobject("wscript.shell")    ' windows shell set objolapp = createobject("outlook.application")      ' outlook set ns = objolapp.getnamespace("mapi")                  ' outlook set box = ns.getdefaultfolder(intfolderoutbox)          ' outlook      each item in box.items              *** here need replace field ****     item.sender = "email2@gmail.com"     item.update      item.save  next 

something following works adding recipient couldn't find equivalent field.

item.recipients.add "email2@gmail.com" 

here doesn't work in case

set oaddrentry = createobject("mapi.addressentry")  oaddrentry.name = system_address  oaddrentry.resolve set onewmsg.sender = oaddrentry onewmsg.update onewmsg.send  

thanks

firstly, once message submitted (and moved outbox) cannot touched - belongs spooler.

secondly, cannot send on behalf of arbitrary user. in case of exchange, set mailitem.sentonbehalfofname property name of exchange mailbox on behalf current user can send. in case of pop3/smtp accounts, set mailitem.sendusingaccount property 1 of accounts namespace.accounts collection.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -