Discussion:
problem in sending email from VFP6
(too old to reply)
sanjib
2006-08-19 06:36:02 UTC
Permalink
dear friend

I made a form to send email from my application, in the send command button
i wrote the following code

o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject="Proforma Invoice"
oitem.to= lctoadd
** To send copy to addresses..
oItem.cc = lcccadd
oitem.body="This mail was sent from invent"
** To attach a file
oitem.Attachments.Add(thisform.txtfile1.value)
** to attach one more file.. and you can repeat this.
oitem.Attachments.Add(thisform.txtfile2.value)
** to send it
oitem.send
** to clear up
o=.null.

but I am getting error

when i click on send it will ask for ( choose profile with window)
and asking for profile name.
if i select any of them

then it will give the following programm error
OLE|Dispatch exception code 4096 from microsoft path does not exist. make
sure thepath is correct.

Then if i say ignore it will send the mail of its own but the receipent get
it in his delete folder.

I am using outlook express 6 and win-xp.

kindly help me how to sort out the problem and how to choose the defaut
profile in my code.
thanks in advance
--
sanjib
Josh Assing
2006-08-19 17:22:55 UTC
Permalink
Outlook Express is NOT outlook.application.
In outlook; if you do not have a default profile defined; you need to either
define one or specify it in your code.
Post by sanjib
dear friend
I made a form to send email from my application, in the send command button
i wrote the following code
o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject="Proforma Invoice"
oitem.to= lctoadd
** To send copy to addresses..
oItem.cc = lcccadd
oitem.body="This mail was sent from invent"
** To attach a file
oitem.Attachments.Add(thisform.txtfile1.value)
** to attach one more file.. and you can repeat this.
oitem.Attachments.Add(thisform.txtfile2.value)
** to send it
oitem.send
** to clear up
o=.null.
but I am getting error
when i click on send it will ask for ( choose profile with window)
and asking for profile name.
if i select any of them
then it will give the following programm error
OLE|Dispatch exception code 4096 from microsoft path does not exist. make
sure thepath is correct.
Then if i say ignore it will send the mail of its own but the receipent get
it in his delete folder.
I am using outlook express 6 and win-xp.
kindly help me how to sort out the problem and how to choose the defaut
profile in my code.
thanks in advance
--- AntiSpam/harvest ---
Remove X's to send email to me.
sanjib
2006-08-21 13:11:02 UTC
Permalink
Thanks Josh

Can u help me how to define default profile code. or how to rectify the
problem.

Please help me.
--
sanjib
Post by Josh Assing
Outlook Express is NOT outlook.application.
In outlook; if you do not have a default profile defined; you need to either
define one or specify it in your code.
Post by sanjib
dear friend
I made a form to send email from my application, in the send command button
i wrote the following code
o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject="Proforma Invoice"
oitem.to= lctoadd
** To send copy to addresses..
oItem.cc = lcccadd
oitem.body="This mail was sent from invent"
** To attach a file
oitem.Attachments.Add(thisform.txtfile1.value)
** to attach one more file.. and you can repeat this.
oitem.Attachments.Add(thisform.txtfile2.value)
** to send it
oitem.send
** to clear up
o=.null.
but I am getting error
when i click on send it will ask for ( choose profile with window)
and asking for profile name.
if i select any of them
then it will give the following programm error
OLE|Dispatch exception code 4096 from microsoft path does not exist. make
sure thepath is correct.
Then if i say ignore it will send the mail of its own but the receipent get
it in his delete folder.
I am using outlook express 6 and win-xp.
kindly help me how to sort out the problem and how to choose the defaut
profile in my code.
thanks in advance
--- AntiSpam/harvest ---
Remove X's to send email to me.
Josh Assing
2006-08-21 15:14:30 UTC
Permalink
set up outlook
run it. if it's not defined, it'll walk you thru it.
that's OUTLOOK not outlook express.
Post by sanjib
Thanks Josh
Can u help me how to define default profile code. or how to rectify the
problem.
Please help me.
--- AntiSpam/harvest ---
Remove X's to send email to me.
sanjib
2006-08-22 05:58:02 UTC
Permalink
Thanks Josh

Now i got the point, but our defaut mail handler is outlook express instead
of microsoft outlook, so how to define or what is the class name of outlook
express like

o=createobject("outlookexpress.application")

this given error "outlookexpres class not found"
can u give me some idea.
--
sanjib
Post by Josh Assing
set up outlook
run it. if it's not defined, it'll walk you thru it.
that's OUTLOOK not outlook express.
Post by sanjib
Thanks Josh
Can u help me how to define default profile code. or how to rectify the
problem.
Please help me.
--- AntiSpam/harvest ---
Remove X's to send email to me.
Jan Bucek
2006-08-22 06:41:21 UTC
Permalink
You can not control OE thru OLE automation. You have to use MAPI
interface. Download MAPImail VCX from www.nbcsoftware.com , it is free
and simple to use.
HTH
Post by sanjib
Thanks Josh
Now i got the point, but our defaut mail handler is outlook express instead
of microsoft outlook, so how to define or what is the class name of outlook
express like
o=createobject("outlookexpress.application")
this given error "outlookexpres class not found"
can u give me some idea.
Josh Assing
2006-08-22 15:36:09 UTC
Permalink
OE does not have a COM model.
I suggest you move on and use SMTP directly -- there are several good tools for
it -- some free -- look on the UT for some solutions

We use West-Wind's IP stack for smtp email
Post by sanjib
Thanks Josh
Now i got the point, but our defaut mail handler is outlook express instead
of microsoft outlook, so how to define or what is the class name of outlook
express like
o=createobject("outlookexpress.application")
this given error "outlookexpres class not found"
can u give me some idea.
--- AntiSpam/harvest ---
Remove X's to send email to me.

Loading...