Linux / UNIX Tech Support Forum
This is a discussion on Sendind Email Using Perl within the Coding in General forums, part of the Development/Scripting category; Dear All, I have two cgi forms.i have to send one email alongwith data of the two forms. Please help ...
|
|||||||
| Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
Sending mail with Perl mail script
How do I send html email from Perl? Code:
#!/usr/bin/perl print "Content-type: text/html\n\n"; $title='Perl Mail demo'; $to='MAIL ADDRESS TO SEND TO'; $from= 'webmaster@YOURDOMAIN.COM'; $subject='YOUR SUBJECT'; open(MAIL, "|/usr/sbin/sendmail -t"); ## Mail Header print MAIL "To: $to\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; ## Mail Body print MAIL "This is a test message from Cyberciti.biz! You can write your mail body text here\n"; close(MAIL); print "<html><head><title>$title</title></head>\n<body>\n\n"; ## HTML content sent, let use know we sent an email print " <h1>$title</h1> A message has been sent from $from to $to </body></html>";
__________________
Vivek Gite Linux Evangelist |
![]() |
| Tags |
| email , perl , perl email , perl mail , smtp |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to forward an email to other account | tom | Getting started tutorials | 4 | 04-03-2010 10:38 PM |
| Email validation in Perl Code Sample | chandanperl | Coding in General | 3 | 12-09-2008 04:50 PM |
| how to send email on every saturday in perl | chandanperl | Coding in General | 4 | 22-08-2008 06:25 PM |
| Email Disclaimer | mvibin | Mail Servers | 2 | 21-05-2008 11:23 AM |
| Automated email | srinivasantarvedi | CentOS / RHEL / Fedora | 4 | 14-04-2008 07:26 PM |