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

Click here to load this message in the networking platform