By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,841 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,841 IT Pros & Developers. It's quick & easy.

send email

P: 9
hi guys,
could any one help me how to write perl script to send email in unix system.

thank you for any helping.
Mar 28 '08 #1
Share this Question
Share on Google+
7 Replies


eWish
Expert 100+
P: 971
Look into using the Mime::Lite or Mail::Sendmail modules which make it easy. Also, if you search the forum you will find posts with the code to an send email. We will help you if you get stuck.

--Kevin
Mar 29 '08 #2

P: 9
thanks for your replying, i checked the link which you gave me. i think i just confused my question, my question is : for example, once you did wrong password in unix, the email would be sent to you. i think the email destination is unix's file, like using 'mail' to check the email in unix.
Mar 29 '08 #3

KevinADC
Expert 2.5K+
P: 4,059
thanks for your replying, i checked the link which you gave me. i think i just confused my question, my question is : for example, once you did wrong password in unix, the email would be sent to you. i think the email destination is unix's file, like using 'mail' to check the email in unix.
Do you know any perl?
Mar 29 '08 #4

P: 9
yes, i just begin to learn perl, so any help for me to write the script. thanks very much.
Mar 29 '08 #5

numberwhun
Expert Mod 2.5K+
P: 3,503
yes, i just begin to learn perl, so any help for me to write the script. thanks very much.
I think that the point that was being made to you is that you need to show us some code. We can provide guidance on modules, but you are going to have to write the code yourself. We will then help you if you get stuck.

Regards,

Jeff
Mar 30 '08 #6

P: 9
thanks for reply, my script as following

Expand|Select|Wrap|Line Numbers
  1. open (SENDMAIL, "| /usr/lib/sendmail -t -n -oi");
  2.   print SENDMAIL "From: user\@domain.com\n";
  3.   print SENDMAIL "To:  root@domain.com\n";
  4.   print SENDMAIL "Subject:  testing 123\n\n";
  5.   print SENDMAIL "Body: hello every\n";
  6. close (SENDMAIL);
but i do not why when i run the script, i can not stop the program, there are many '&EFO' at the end of the program.
Mar 30 '08 #7

KevinADC
Expert 2.5K+
P: 4,059
thanks for reply, my script as following

Expand|Select|Wrap|Line Numbers
  1. open (SENDMAIL, "| /usr/lib/sendmail -t -n -oi");
  2.   print SENDMAIL "From: user\@domain.com\n";
  3.   print SENDMAIL "To:  root@domain.com\n";
  4.   print SENDMAIL "Subject:  testing 123\n\n";
  5.   print SENDMAIL "Body: hello every\n";
  6. close (SENDMAIL);
but i do not why when i run the script, i can not stop the program, there are many '&EFO' at the end of the program.
the sendmail stuff looks OK. But nobody here will know why your program that we can not see will not stop.
Mar 31 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.