![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sending mail from unix | anki_1 | UNIX for Dummies Questions & Answers | 3 | 04-09-2008 04:03 PM |
| Sending mail thu unix | hellotosatish | UNIX for Dummies Questions & Answers | 6 | 09-15-2007 09:46 PM |
| sending email via mail server | parmeet | UNIX for Advanced & Expert Users | 1 | 02-09-2007 02:39 AM |
| Sending msg From Unix Server to an E-mail Address | cgege | HP-UX | 2 | 12-04-2006 04:31 PM |
| block certain domain from sending mail to server | legato | UNIX for Dummies Questions & Answers | 2 | 10-01-2006 09:43 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Sending mail in C/C++ in unix server
Hi Frnds,
I have a task in my project wherein i have to send out a mail from my C++ code.With some file attachements.Please help me in this. At a higher level wat i can tell is my code generated 3 csv file and i have to send these files as attachement. My code is executed in unix server.So please suggest me how to do this. If possible also please tell me how to do this in windows also. Thanks in advance please reply asap. |
|
||||
|
Use fork()/exec()/wait() or system() to run a shell script to wrap the email client.
Use MAPI2. |
|
||||
|
But you can program in C & C++?
On UNIX, I was suggesting you write a script to wrap the email functionality so this can be customized without recompilation, then call this from the C++ program. On Windows you should use the MAPI 2 interface, this provides an COM/OLE interface to a mail provider and supports adding attachments as part of the API. |
|
||||
|
I'm in agreement with the other folks in this thread that
using established systems mail tools to accomplish what you are doing is simpler. If you really need to do the entire project in C you could take a look at libesmtp -- libESMTP - A Library for Posting Electronic Mail Or possibly the c-client library bundled with UW imap: UW IMAP software--IMAP Information Center. |
|
||||
|
popen is a very simple function to use. It allows you to open a system command as a FILE stream, for reading or writing. To send an email, you will want to open a stream for writing so you can "print" the contents of the email into the function:
Quote:
|
![]() |
| Bookmarks |
| Tags |
| sendmail |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|