Programming C# C++ (7) Delphi (617) Java (8) JavaScript (31) perl (9) mysql (3) perl CGI (3) php (4) VBScript (1) Visual Basic (1)
Exchange Links About this site Links to us 
|
Send an email from my perl script
3 comments. Current rating: (2 votes). Leave comments and/ or rate it.
Question: How can my perl script send an email? I'm working under Linux.
Answer: The solution below assumes that sendmail is installed as /usr/lib/sendmail. You might have to adjust the first line appropriately.
 | |  | |
$mailprog = '/usr/lib/sendmail';
open(MAIL,"|$mailprog -t");
print MAIL "To: bill_gates\@macrosoft.com\n";
print MAIL "From: your_mother <no_reply\@family.org>\n";
print MAIL "Subject: $subject\n\n";
print MAIL 'This message is a test.';
close (MAIL);
| |  | |  |
Comments:
|
anonymous from United States
|
 |
|
|
its nice
|
|
anonymous from Madras, India
|
 |
|
|
doesn't work for me.....
|
|
anonymous from India
|
|
|
|
how to send attachment
|
|