Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send outlook email in VFP without running Outlook 1

Status
Not open for further replies.
Jul 20, 2001
4
US
Hi everyone,

I can login to Outlook using the MAPI Session control without running Outlook in the background but when MAPI Message control method Send(.F.) is encountered it gives me a login failed message. MAPI Session control SessionID exists and is assigned to the MAPI Message control sessionID. With outlook running in the background, email is sent successfully. What am I doing wrong?

Thanks in advance.
 
PLease refer my FAQ
How can I send an Email using OUTLOOK from VFP?
faq184-766

1. Outlook (2000 or 98 or 97) must be installed for this to work.

2. Save the following in a command button click event .. so that when you click this will be sent as an email
Or Save as prg file and run the file to send the email.

*****************************************
o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject="Email From VFP6"
oitem.to="ramani_g@yahoo.com"
oitem.body="This mail was sent from vfp using Outlook98"
oitem.Attachments.Add("MyFullPath+MyFile+Ext")
oitem.send
o=.null.
*****************************************
I think what you are looking for is the code in line..
oItem.send
Hope this helps:) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Initially, I used your code from FAQ184-766 but it launched Outlook and asked for ID and password. I want to bypass all that and do it all programatically. So I switched to using MAPI and I have the problem as mentioned in my first post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top