Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending via outlook from a different user revisited
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01340392
Message ID:
01340696
Views:
14
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform