|
-
November 7th, 2006, 04:26 AM
#1
Send Email through C/C++ Linux
I would like create a program in C/C++ to send email using smtp.
Does anyone has this experience and can share?
Thanks
-
November 7th, 2006, 05:59 AM
#2
Re: Send Email through C/C++ Linux
Search for already built libs that will help you with this.. however a system command would also do the job.
Do man mail or mailx or Mail on your unix/linux terminal to know details.
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
-
November 7th, 2006, 10:05 AM
#3
Re: Send Email through C/C++ Linux
The sendmail program is very complete AFAIK.
"inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
Club of lovers of the C++ typecasts cute syntax: Only recorded member.
Out of memory happens! Handle it properly!
Say no to g_new()!
-
November 8th, 2006, 04:45 AM
#4
Re: Send Email through C/C++ Linux
Did you mention "sendemail" program?
I am able to get the source code for sendemail, but there are a list of folders and files, which is the one that I should use?
Thanks
-
November 8th, 2006, 06:30 AM
#5
Re: Send Email through C/C++ Linux
You don't have to use sendmail's source code.
It's designed to be invoked as a child process of your process with a fork/exec or a similar mechanism.
You have to:
- Learn the command line interface of sendmail described in the man page:
http://unixhelp.ed.ac.uk/CGI/man-cgi?sendmail - Invoke sendmail, redirecting its standard input, and eventually, the standard output & standard error stream.
Note: sendmail can be launched as a daemon with the -bd option.
It can be useful if you want that mails can be sent even when your program is exited, useful for large messages & non-responding SMTP destination servers.
 Originally Posted by man page
Sendmail is not intended as a user interface routine; other programs
provide user-friendly front ends; sendmail is used only to deliver pre-
formatted messages.
sendmail is designed for this type of usage.
It's simple & powerful.
"inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
Club of lovers of the C++ typecasts cute syntax: Only recorded member.
Out of memory happens! Handle it properly!
Say no to g_new()!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|