Information générale
Catégorie:
Applications Internet
put this code in class called outlook <g> from custom base
Since Outlook already knows about your mail setup, it requires less information
if not empty(this.email)
local oOutlook
oOutlook = CREA ("outlook.application")
oMail = oOutlook.createitem(0)
omail.Body = This.Message
omail.Recipients.Add ( this.email )
omail.Subject = This.Subject
if not empty(this.attachment) and file(this.attachment)
omail.attachments.add(this.attachment)
endif
IF THIS.ReviewFlag = .T.
oMail.Display
ENDIF
omail.Send
omail = .NULL.
RELEASE omail
oOutlook = .NULL.&& This can be moved to MAIN.PRG
RELEASE oOutlook
else
Messagebox("el destinatario esta en blanco!")
endif
i use and works fine
Best Regards
Francisco Morosini
>Hi,
>
>I've developed an application on a Winnt machine, which automatically sends off an e-mail, with an attachment. This works fine on my Winnt machine, but when I come to run it on a Win98 machine, I get my e-mail popping up on screen stating that "This message has not been sent". If I click the send button, the e-mail fires off ok.
>I've compared the various options in Outlook on both machines, but can't find anything that looks like it will cure this problem. I've noticed that you can put (.T.) at the end of the objMessage.Send line, but this seems to be ignored as I can't even get it to bring up this box on my PC using the (.F.) option.
>
>I've included the code below in case it helps.
>
>* Create the session
>objSession = CREATEOBJECT("mapi.session")
>
>* Create a Macro to specify the profile name (profile = "Microsoft Outlook")
>MMACMD = 'OBJSESSION.LOGON'+IIF(LEN(MPROFNAME)>0,'("'+MPROFNAME+'")',"")
>&MMACMD
>
>* Create the e-mail
>objMessage = objSession.Outbox.Messages.Add
>objMessage.Subject = "BCC"
>
>*Add the attachment
>objMessage.Attachments.Add("bcc.pgp", 0, 1, "c:\cfc\bcc.pgp")
>
>*Add the Recipient
>objRecip = objMessage.Recipients.Add(mmailto)
>objRecip.Resolve
>
>*Send it
>objMessage.Send
>
>*Clean up
>objSession.Logoff
>RELEASE objRecip, objMessage, objSession
>
>
>Any ideas guys?
>
>Mark.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement