Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending via outlook from a different user revisited
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01340392
Message ID:
01340760
Vues:
12
Thx Mike

>>I have the following code to send an email with MS Outlook "from" a different email address than the one the user is currently logged in as:-
>>
>>
>>
>>sItem = safeitem
>>sItem.Item = oMailItem
>>tag = sItem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}", "From")
>>tag = BITOR( tag, 0x1E) && the type is PT_STRING8 (UNICODE) && Foxpro
>>
>>sItem.Fields.Item[Tag].Value = "Someone <whoever@domain.com>"
>>
>>sItem.Fields.Item(0x0C1E001E).Value = "SMTP" && type address
>>sItem.Fields.Item(0x0C1A001E).Value = "Someone" && sender name
>>sItem.Fields.Item(0x0C1F001E).Value = "whoever@domain.com" && sender email address
>>
>>sItem.Subject = sItem.Subject  'to trick Outlook into thinking that something has changed
>>
>>safeitem.save()
>>safeitem.send()
>>
>>
>>I can't seem to get the code to work? Can anyone help?
>
>Another option is the SendOnBehalhOf property, which allows you to send on behalf of another e-mail address. So the outgoing e-mail will go with the default account but when they reply, they will reply to the other e-mail address. Other than that like Sergey said CDO you can put any name or email address in the from, valid or not, CDO doe not seem to care.
Rob
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform