|
#include "CSmtp.h"
#include <conio.h>
int main()
{
CSmtp mail;
if(mail.GetLastError() != CSMTP_NO_ERROR)
{
printf("Unable to initialise winsock2.\n");
return -1;
}
mail.SetSMTPServer("smtp.wp.pl",25);
mail.SetLogin("***");
mail.SetPassword("***");
mail.SetSenderName("JP");
mail.SetSenderMail("mail@domain.com");
mail.SetReplyTo("mail@domain.com");
mail.SetSubject("The message");
mail.AddRecipient("friend@domain.com");
mail.SetXPriority(XPRIORITY_NORMAL);
mail.SetXMailer("The Bat! (v3.02) Professional");
mail.SetMessageBody("This is my message.");
mail.AddAttachment("c:\\test.exe");
mail.AddAttachment("c:\\test2.jpg");
if( mail.Send() )
printf("The mail was send successfully.\n");
else
{
printf("%s\n",GetErrorText(mail.GetLastError()));
printf("Unable to send the mail.\n");
}
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.