Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I forward an email using PERL? 1

Status
Not open for further replies.

rcsen

Programmer
Jan 11, 2001
51
US

I would like to "FORWARD" or "DELETE" or "REPLY" to an email using Perl. For my case, let us assume the email to be saved in a text file. So how do I proceed with replying or deleting or forwarding. It will be of great help, if you help me.
Thanks
 
Read faq219-364 to learn how to send email. In order to reply, you'll have to open the text file and parse the contents of the FROM: field and put that address in the TO: field of your new email. The body of the email remains the same. You could do a "foreach $line" through the body and put a > in front of it if you wanted. There are lots of threads in this forum about how to open a file and parse the contents. Do a search. Some of them are just a few threads away.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
If you have a PERL script already started, please post the code you are haveing trouble with so all of us can look at it and help with the code. I also suggest looking through some of the threads here. You will find they are very informative and answer most of your questions without having to post a new thread. Your code is most helpful is solving your specific problems.:)
 
Hi Mr.Tanderso and Mr.Haunter,

I am very new to Perl Language. I tried with sendmail in UNIX. Then I could send mails. But I couldn't find the Sendmail.pm or Mail.pm Modules in Perl.I have seen some codes to forward mails containing Sendmail.pm which fails to compile giving the error message as could not find Mail.pm. Could suggest me some way of doing the forwarding,replying and deleting without using the same.Because I couldn't parse the header and get the contents.
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top