Results 1 to 2 of 2

Thread: Sendind Email Using Perl

  1. #1
    Member
    Join Date
    Feb 2008
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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,

  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,513
    Thanks
    17
    Thanked 807 Times in 511 Posts
    Rep Power
    10

    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>";
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to forward an email to other account
    By tom in forum Getting started tutorials
    Replies: 8
    Last Post: 27th June 2012, 01:12 PM
  2. Email validation in Perl Code Sample
    By chandanperl in forum Coding in General
    Replies: 3
    Last Post: 12th September 2008, 04:50 PM
  3. how to send email on every saturday in perl
    By chandanperl in forum Coding in General
    Replies: 4
    Last Post: 22nd August 2008, 06:25 PM
  4. Email Disclaimer
    By mvibin in forum Mail Servers
    Replies: 2
    Last Post: 21st May 2008, 11:23 AM
  5. Automated email
    By srinivasantarvedi in forum CentOS / RHEL / Fedora
    Replies: 4
    Last Post: 14th April 2008, 07:26 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •