本程序编写了一个类CIMapi,用于在应用程序中插入发送邮件的功能,参考下面的一个应用:
#include <mapi.h> #include "imapi.h" void CBugReport::OnOK() { CIMapi mail; mail.To("[email protected]"); // Set recipient name mail.To("[email protected]"); // Second recipient mail.Cc("[email protected]"); // CC recipient // Identify sender (not strictly necessary since MAPI will fill this in for you) mail.From("[email protected]"); mail.Subject("Test Email"); // Subject of this email mail.Attach("somefilename"); // Attaching a file // Attach another file but give it a different name inside the email itself mail.Attach("someotherfile", "different_name_for_recipient"); // Put text of message in body mail.Text("Body text for this email"); // Set body text mail.Send(); // Now send the mail! CDialog::OnOK(); }
>>> DOWN !!! >>>下载源代码及演示程序