Sending emails in HTML format

Discussion in 'Programming' started by bscdesign.com, Mar 5, 2007.

  1. #1
    How do you do this?
     
    bscdesign.com, Mar 5, 2007 IP
  2. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Outlook Express? ;)

    I bet you'd rather use PHP instead, right? :)
    Well, in this case have a look at this PEAR class:
    http://pear.php.net/package/Mail

    HTH, cheers!
     
    picouli, Mar 5, 2007 IP
  3. technoguy

    technoguy Notable Member

    Messages:
    4,369
    Likes Received:
    306
    Best Answers:
    0
    Trophy Points:
    205
    #3
    Have a look here I always use this for sending html mail using php. I hope you will get some idea from it.
     
    technoguy, Mar 5, 2007 IP
  4. bscdesign.com

    bscdesign.com Active Member

    Messages:
    681
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Is there a way to do it in perl/cgi? I would think it is very similar.
     
    bscdesign.com, Mar 5, 2007 IP
  5. tnd

    tnd Well-Known Member

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #5
    If you want to send with perl you need module MIME::Lite and here is the example of code

    
    #!/usr/bin/perl -w
    use strict;
    use MIME::Lite;
    
    # SendTo email id
    my $email = ‘user@somewhere.com’;
    
    # create a new MIME Lite based email
    my $msg = MIME::Lite->new
    (
    Subject => “HTML email test”,
    From    => ‘YOU@somewhere.com’,
    To      => $email,
    Type    => ‘text/html’,
    Data    => ‘<H1>Hello</H1><br>This is a test email.
    Please visit our site <a href=”http://somewhere.com/”>somewhere.com</a><hr>’
    );
    
    $msg->send();
    
    Code (markup):
     
    tnd, Mar 5, 2007 IP
  6. bscdesign.com

    bscdesign.com Active Member

    Messages:
    681
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Thank you tnd. I will use this.
     
    bscdesign.com, Mar 5, 2007 IP