To send email with image

To send email with image

Postby Kleyton » Wed Aug 09, 2006 12:36 pm

it has as to below insert image in the sending of email in the example?

#include "fivewin.ch"
****************
FUNCTION SendMail
*****************
LOCAL oOutLook,oMailItem,oRecip,oAttach

oOutLook := TOleAuto():New("Outlook.Application")

oMailItem := oOutLook:Invoke("CreateItem", 0)

oRecip := oMailItem:Invoke("Recipients")
oRecip:Invoke("Add", "lara.softhouse@gmail.com")
oRecip:Invoke("Add", "cleiton.softhouse@bol.com.br")

oMailItem:Set("Subject", "Testing e-mail via ole fw")

oMailItem:Set("Body", "Assunto, referente fatura 0001 no valor de "+CRLF+ ;
"R$ 1.500,00"+CRLF+CRLF+"Tudo Informática"+CRLF)

oAttach := oMailItem:Invoke("Attachments")
oAttach:Invoke("Add", "c:\autoexec.bat")
oAttach:Invoke("Add", "c:\config.sys")

oMailItem:Invoke("Send")

oRecip:End()
oAttach:End()
oMailItem:End()
oOutLook:End()

MsgInfo("Mensagem enviado com sucesso !")

RETURN NIL
Kleyton
Fwh906
Brazil
Kleyton
 
Posts: 49
Joined: Thu Dec 22, 2005 12:50 pm

Postby Kleyton » Wed Aug 09, 2006 2:44 pm

please
Kleyton
Fwh906
Brazil
Kleyton
 
Posts: 49
Joined: Thu Dec 22, 2005 12:50 pm

Postby Kleyton » Thu Aug 10, 2006 2:46 pm

Help, please !!!
Kleyton
Fwh906
Brazil
Kleyton
 
Posts: 49
Joined: Thu Dec 22, 2005 12:50 pm

Re: To send email with image

Postby E. Bartzokas » Thu Aug 10, 2006 4:41 pm

Kleyton wrote:it has as to below insert image in the sending of email in the example?

#include "fivewin.ch"
****************
FUNCTION SendMail
*****************
LOCAL oOutLook,oMailItem,oRecip,oAttach

oOutLook := TOleAuto():New("Outlook.Application")

oMailItem := oOutLook:Invoke("CreateItem", 0)

oRecip := oMailItem:Invoke("Recipients")
oRecip:Invoke("Add", "lara.softhouse@gmail.com")
oRecip:Invoke("Add", "cleiton.softhouse@bol.com.br")

oMailItem:Set("Subject", "Testing e-mail via ole fw")

oMailItem:Set("Body", "Assunto, referente fatura 0001 no valor de "+CRLF+ ;
"R$ 1.500,00"+CRLF+CRLF+"Tudo Informática"+CRLF)

oAttach := oMailItem:Invoke("Attachments")
oAttach:Invoke("Add", "c:\autoexec.bat")
oAttach:Invoke("Add", "c:\config.sys")

oMailItem:Invoke("Send")

oRecip:End()
oAttach:End()
oMailItem:End()
oOutLook:End()

MsgInfo("Mensagem enviado com sucesso !")

RETURN NIL


Kleyton,
I can't really offer much of an advise, and don't even understand exactly the problem you have.
At a glance of an eye based only on programming knowledge, is one thing:
You End() the oRecip, the oAttach, and the oMailItem, after you "Send" the message. Perhaps, this might be a good reason for non working.

Sorry if I cannot help you more, but if you tell me what the problem is, I might look at it.

By the way, I do not use emailing through Outlook or Netscape or any other available emailer program, but a library that I have purchased, which gives me all the flexibility to send/receive, etc. emails with attachments. It is called SMTP / POP3 EMAIL COMPONENT, and is available from <www.marshallsoft.com>, also it is available for evaluation before you buy it, and is very easy to use!

Kind regards
Evans
User avatar
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Postby Antonio Linares » Thu Aug 10, 2006 5:01 pm

Kleyton,
Code: Select all  Expand view
oMailItem:Set( "HTMLBody", '<HTML><HEAD></HEAD><BODY><img src="http://www.fivetechsoft.com/images/logo5t2.gif"</BODY></HTML>' )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41356
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Thu Aug 10, 2006 5:17 pm

Kleyton,

Why not just use FW's own TMail class?

James
--------------------------------------
MAPI Mail Syntax:

DEFINE MAIL [ <oMail> ];
[ SUBJECT <cSubject> ];
[ TEXT <cText> ];
[ TYPE <cType> ];
[ DATE <dDate> ];
[ TIME <cTime> ];
[ CONVERSATION <cConversation> ]:
[ RECEIPT ];
[ FROM USER ];
[ FILES <cFilename1> ,<cDescript1>, <cFilenameN>, <cDescriptN> ] ];
[ ORIGIN <cOrigin> [ <cOriginAddress> ] ];
[ TO <cTarget1>, [ <cTargetAddress1> ] [ <cTargetN> [ <cTargetAddressN> ] ] ];

FILES
When specifying an attachment file you must include the path and a description. Use a two dimensonal array, the first element is the filename with path, the second is the description. You can have multiple files by adding more elements.

aFiles:={"c:\my docments\mydoc.doc","mydoc.doc"}

If the attachment file is html (has a .htm or .html extension) and you do not specify any TEXT (a message) then the file will appear in the message area.

ERRORS
If you specify a TO and the parameter is blank and you are using the FROM USER clause, the message compose box will not appear. Likewise if the filename is invalid or not found. It is best to use an error trap:

DEFINE MAIL...
ACTIVATE MAIL...

IF oMail:nRetCode!=0
MsgAlert("The message could not be sent due to an error."+CRLF+;
"MAPI error code: "+ltrim(str(oMail:nRetCode)),"Alert")
ENDIF
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ari » Fri Nov 10, 2006 9:08 pm

DEFINE MAIL

com incredimail não aparece o texto corretamente

www.incredimail.com

Ari
User avatar
Ari
 
Posts: 224
Joined: Fri Feb 03, 2006 4:21 pm
Location: São Paulo, SP - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 18 guests