Send Message

9 views
Skip to first unread message

dvasilakis

unread,
Aug 12, 2009, 11:05:16 AM8/12/09
to Nektra OEAPI Support
I want to send email with the below code

BodyHandler = OEAPIMessage.InsertBody(0,
tagOEAPIBODYLOCATION.OE_IBL_ROOT)

OEAPIMessage.SetBodyProp(BodyHandler,
tagOEAPIMIMEPROPID.OE_PID_HDR_FROM, "")
OEAPIMessage.SetBodyProp(BodyHandler,
tagOEAPIMIMEPROPID.OE_PID_HDR_SENDER, "")
OEAPIMessage.SetBodyProp(BodyHandler,
tagOEAPIMIMEPROPID.OE_PID_HDR_TO, NewMessage.To.AsString)
OEAPIMessage.SetBodyProp
(BodyHandler,tagOEAPIMIMEPROPID.OE_PID_HDR_SUBJECT,
NewMessage.Subject)
OEAPIMessage.SetBodyText(BodyHandler, NewMessage.BodyHtmlText, "text",
"html")

OEAPIMessage.SetState(tagOEAPIMSGSTATE.OE_MSG_UNSENT)

OEAPIMessage.SetFolderID(Outbox.GetID)
OEAPIMessage.Commit()

'NewMailToSend = OEAPIOutbox.CreateMessage
(OEAPIMessage.GetAllSource)
OEAPIObject.SendMessage(OEAPIOutbox.GetID, OEAPIMessage.GetID)

It works fine with a small problem.
The mail appears twice in outbox. When the mail have been sent, in
outbox remains one copy of the mail.


Nektra OEAPI Support

unread,
Aug 12, 2009, 4:17:15 PM8/12/09
to Nektra...@googlegroups.com
Hi again,

As stated on the Product's Documentation, the SendMessage function "makes a copy of the the specified message in the Outbox folder, and modifies this copy to be able to be sent".
You can create the message on another folder, like Drafts, and delete it after calling SendMessage if you want to.

Regards,

Federico
-- 
Nektra Advanced Computing
http://www.nektra.com
Reply all
Reply to author
Forward
0 new messages