send email via C++

send email via C++

Post by William L. Thomson Jr » Thu, 20 Feb 2003 06:24:28



I am in search of a easy way to send an email from from my GTK app via
C++. A library, or API is what I am looking for I think. I do not think I
want to use the system() function to pass what I need to sendmail.

In fact I would like to do this from a machine that does not have sendmail
installed.

I do not think I want to code all of this myself. Meaning opening a socket
to a smtp server, dealing with mime types, and etc to send my email.
Unless of course someone has or knows of a good example of this.

Anyone have any suggestions, links, or recommendations?

Thanks

--
Sincerely,
William

 
 
 

send email via C++

Post by Sybren Stuve » Thu, 20 Feb 2003 06:33:57


William L. Thomson Jr. enlightened us with:

Quote:> I am in search of a easy way to send an email from from my GTK app via
> C++. A library, or API is what I am looking for I think.

Search for "smtp api" on www.freshmeat.net - should give you plenty of
stuff.

Sybren
--
| Somebody ought to cross ball point pens with coat hangers so that |
| the pens will multiply instead of disappear.                      |
\-------------------------------------------------------------------/
If you have to use Outlook, fix it: http://jump.to/oe-quotefix

 
 
 

send email via C++

Post by torste » Thu, 20 Feb 2003 07:50:31


Quote:>I do not think I want to code all of this myself. Meaning opening a socket
>to a smtp server, dealing with mime types, and etc to send my email.
>Unless of course someone has or knows of a good example of this.

>Anyone have any suggestions, links, or recommendations?

The smart way is to get an smtp library, which will allow you to
send mail.  If you don't want the external dependency, then
sending via smtp directly is very very simple.

First, open a connection to the domain mail server of the
intended destination.  You can lookup the mx from the domain
DNS.

Second, the port to open is 25.

Third, all you have to do is read/write the SMTP protocol.
Here's a primer.

http://opop.nols.com/write/SMTP.html

Torsten

 
 
 

1. How can I send email via C++?

I am trying to write a C++ program to send an email message.  The only
way I've found to do it, so far, is to write an EXPECT script to interact
with the mail program.  I don't like this way.

Has anyone written their own mail handlers?  Is there some library that
facilitates sending mail?

btw, I don't need to receive/check mail, only send it.
------------------
Brian Withun
ONS

2. xspread

3. extract email from text file and send an email to the email address

4. tcpip configuration

5. How do I send an email from my C/C++ Program ???

6. RedHat Install from CD-ROM problems

7. Sending email from a C++ or Java program

8. Thread Library Semaphores

9. Sending a file via email from unix to Microsoft Outlook 2000

10. how to send attachment via email in script?

11. can't send out email via pine and port 110 can't connected

12. Sending syslogd messages via email

13. Argh - can't send e-mail with KMail via yahoo!