The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


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
How to send mail in Unix konankir Shell Programming and Scripting 6 06-12-2008 05:28 AM
send mail from UNIX prashanth_gs SUN Solaris 5 12-18-2006 04:25 PM
I am not able to send mail form unix to other mail accounts. chinnigd UNIX for Dummies Questions & Answers 1 04-06-2006 05:31 AM
how to send mail in unix rajan_ka1 Shell Programming and Scripting 12 01-10-2006 11:47 PM
can not send mail from unix server to company/yahoo mail b5fnpct UNIX for Dummies Questions & Answers 5 11-22-2002 06:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-05-2004
Registered User
 

Join Date: Feb 2004
Posts: 2
? i want to send a mail with a C code under Unix ?

Hi all !
I want to know if i can send an email with a C code...

the thing i wanna do is when my code is finished it creates a log file with all the information of the process in it...i want to know if its possible at the and of my code in C, under Unix_Solaris, to send that log file to a specified email adress and thats it ?

Thanks for answering fast !
Unknown Coder
Reply With Quote
Forum Sponsor
  #2  
Old 02-05-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Yes it's possible. I would just use a popen() to a mailx process.
Reply With Quote
  #3  
Old 02-05-2004
Registered User
 

Join Date: Feb 2004
Posts: 2
and how can i use this method ?

if you have a doc or something to help me with that...it will be appreciated thanks !
Reply With Quote
  #4  
Old 02-05-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
Try "man popen". I don't have a popen doc.
Reply With Quote
  #5  
Old 02-19-2004
Registered User
 

Join Date: Feb 2004
Location: UK
Posts: 4
I've done this in C++ using a system command

mailx -s SUBJECT yourname@yourE-MailAddress < logFile

write the above code into a char string then use:

system ( command );

in your code, the SUBJECT can be set to anything you want, and the logFile is simply a file with all the info you want in your e-mail.

You might have to play around with your e-mail address, test it in a shell window first, I had to use @intranet since it was internal.

Hope this helps.

Cheers
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0