Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email from C++

Status
Not open for further replies.

Pinpoint

Programmer
Dec 23, 2001
49
GB
Hi,

Can anyone point me to a Unix C++ email package. I need one I can install on my server and then #include and simply call a function from within my code to send a string of text as an email ? Please include the web-site URL where I can download.

Thanks.
 
Sending an email is not simple. The best thing to do is probably to hand the email off to your MTA, such as Sendmail.

//Daniel
 
It is very simple. You should have mutt on your system and simply built a command string.
syscode is a string object.


syscode.erase();
syscode.append("echo '");
syscode.append(Text);
syscode.append("' | mutt ");

if (Attachment.length() > 0)
{
syscode.append("-a '");
syscode.append(Attachment);
syscode.append("' ");
}

syscode.append("-s '");
syscode.append(Subject);
syscode.append("' ");
syscode.append(EmailList);
sysc = (char *) syscode;
return (system(sysc));
 
Thanks. What is mutt ? And where does it come from.
 
Mutt is an email client, and you should be able to get an rpm somewhere. Do a search on Mutt.

The mail unix command should also work, but I am not sure it will handle attachments. try man mail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top