Page 1 of 1

To send email with image

PostPosted: Wed Aug 09, 2006 12:35 pm
by Kleyton
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

PostPosted: Thu Aug 10, 2006 5:28 pm
by Antonio Linares
Kleyton,
Code: Select all  Expand view
oMailItem:Set( "HTMLBody", '<HTML><HEAD></HEAD><BODY><img src="http://www.fivetechsoft.com/images/logo5t2.gif"</BODY></HTML>' )

PostPosted: Fri Aug 11, 2006 11:25 am
by Kleyton
Antonio Linares, Debtor for the aid, but did not give certain, did not insert the image in the body of the email.

He has as to use this process of sending of email for the OutlookExpress?

PostPosted: Sat Aug 12, 2006 5:48 am
by James Bott
Kleyton,

You cannot use OLE with Outlook Express, but you can use FW's TMail class. See my reponse to your message in the FWH section.

James

PostPosted: Sat Aug 12, 2006 6:42 am
by Antonio Linares
Kleyton,

Here it works fine with Outlook 2003 (not Outlook Express).