01-21-2008
Quote:
Originally Posted by
electroon
Can u please tell more details i am somewhat naive user
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:
FILE *mailer = popen("/usr/bin/mail -s 'Some subject here' user@domain", "w");
fprintf(mailer, "Hello %s,\nThis note is to inform you that your job completed successfully.\n", username);
pclose(mailer);
You would, of course, want to add some error checking to this.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi
currently i have a server that is able to send out and receive mail.
is there a way to configure the server such that mails can be sent to a certain domail like abc@yahoo.com but block mails from this domain abc@yahoo.com.
the server is running on solaris 10.
thanks in advance :) (2 Replies)
Discussion started by: legato
2 Replies
2. HP-UX
Dear Brothers in Unix
I would like to change some HP-UX settings in order that the system send a message to root it should be copied to my e-mail address in Microsoft Exchange Server.
Please can you help me.
Best Regards and thanks in advance
Gege (2 Replies)
Discussion started by: cgege
2 Replies
3. UNIX for Advanced & Expert Users
hi everyone
i am facing one problem.
there is one unix server in our organisation which stores daily routine backup, and one mail server which is on windows 2k3, they are on one intranet.
now i want that a mail should be generated and sent to the e-mail id of employees like nitin@hotmail.com... (1 Reply)
Discussion started by: parmeet
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am using mailx command to send mail through Unix. But I am able to send mail only within my domain. If i want to send mail to some other server, it's not working. Like say If I want to send mail to someone on gmail or yahoo it's not working. but it's working fine within my company domain.... (3 Replies)
Discussion started by: anki_1
3 Replies
5. Linux
Hi,
I coded a bash script.I m trying to use this command in the script
mail -s "test" user@abc.com
I tried this command on prompt.however it hangs.I check /var/log/maillog/
stat=Deferred: Connection timed out with mail.rdmedia.com.
sendmail: n0M8lscO014303: localhost did not issue... (2 Replies)
Discussion started by: sunsail
2 Replies
6. Programming
hi all,
please help me in this regard. I am VFP 9 programmer. I want to send the mail from within VFP 9 application. I have used CDO of microsoft which is working fine. however to be able to send the mail i have to setup the router gateway on user machine which enable him to surf through the... (0 Replies)
Discussion started by: choudharidl
0 Replies
7. HP-UX
We have configured our mail unix server and can send out emails automatically from applications running on unix to different people in our company as well as outside our company. However there is an outside client who is not receiving these emails because the settings on their mail server cannot... (4 Replies)
Discussion started by: Tenyhwa
4 Replies
8. Shell Programming and Scripting
Here is the code:
<?php
//new function
function loadini($path) {
$fp = fopen($path, "r");
$fpcontents = fread($fp, filesize($path));
fclose($fp);
return $fpcontents;
}
$to = "test@test.com";
$nameto = "notme";
$from = "test";
$namefrom = "Who From"; ... (0 Replies)
Discussion started by: galford
0 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I want to send an email from unix. I tried following commands:
mailx -s "hello" manish.xxx@xxx.com < echo_manish
and
echo "Testing Mail" | mailx -s "hello" manish.xxx@xxx.com
but in both the commands nothing is happening. I mean it is neither giving any error nor I am receiving... (7 Replies)
Discussion started by: manishdivs
7 Replies
10. Shell Programming and Scripting
I'm unable to send email from my Linux server despite SMTP port 25 Active and Listening.
# hostname
TechX
I checked the mail log ( /var/log/maillog ) and found the below error.
I'm sharing all the ".cf" files seen in the error log.
1.
# more /etc/postfix/main.cf
# postfix... (0 Replies)
Discussion started by: mohtashims
0 Replies
System Administration Commands etrn(8)
NAME
etrn - start mail queue run
SYNOPSIS
etrn [-v] server-host [client-hosts]
DESCRIPTION
SMTP's ETRN command allows an SMTP client and server to
interact, giving the server an opportunity to start the pro
cessing of its queues for messages to go to a given host.
This is meant to be used in start-up conditions, as well as
for mail nodes that have transient connections to their ser
vice providers.
The etrn utility initiates an SMTP session with the host
server-host and sends one or more ETRN commands as follows:
If no client-hosts are specified, etrn looks up every host
name for which sendmail(1M) accepts email and, for each
name, sends an ETRN command with that name as the argument.
If any client-hosts are specified, etrn uses each of these
as arguments for successive ETRN commands.
OPTIONS
The following option is supported:
-v The normal mode of operation for etrn is to do all of
its work silently. The -v option makes it verbose,
which causes etrn to display its conversations with
the remote SMTP server.
ENVIRONMENT
No environment variables are used.
FILES
/etc/mail/sendmail.cf sendmail configuration file
SEE ALSO
sendmail(1M), RFC 1985.
CAVEATS
Not all SMTP servers support ETRN.
CREDITS
Leveraged from David Muir Sharnoff's expn.pl script. Chris
tian von Roques added support for args and fixed a couple of
bugs.
AVAILABILITY
The latest version of etrn is available in the contrib
directory of the sendmail distribution through anonymous ftp
at ftp://ftp.sendmail.org/ucb/src/sendmail/.
AUTHOR
John T. Beck <john@beck.org>