nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Sendind Email Using Perl

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 ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Linux answers from nixCraft.


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.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 29-09-2008, 06:21 PM
Member
User
 
Join Date: Feb 2008
OS: fedora
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
chandanperl is on a distinguished road
Default Sendind Email Using Perl

Dear All,
I have two cgi forms.i have to send one email alongwith data of the two forms.
Please help me.
Thanks,
Reply With Quote
  #2 (permalink)  
Old 08-10-2008, 12:41 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

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
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply

Tags
email , perl , perl email , perl mail , smtp


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

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


All times are GMT +5.5. The time now is 05:42 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38