How do i send email as HTML format using Net::SMTP_auth

Discussion in 'Perl Misc' started by arun, Mar 23, 2005.

  1. arun

    arun Guest

    Hi
    How do i send HTML Mail using Perl Module Net::SMTP_auth. Right now i
    can able to send the mail but the receipents are able to view all the
    HTML tags. How to resolve this.

    With Regards
    Arun
     
    arun, Mar 23, 2005
    #1
    1. Advertising

  2. Gregory Toomey, Mar 23, 2005
    #2
    1. Advertising

  3. arun

    Mike Guest

    Arun,

    I use MIME::Lite to form the email body before sending.
    Here $pagetosend is the whole html page.

    -------code snip--------
    use MIME::Lite;

    ### Create the multipart container
    my $msg = MIME::Lite->new (
    From => $from_address,
    To => $to_address,
    Subject => $subject,
    Type => 'text/html',
    Data=> $pagetosend
    ) or die "Error creating inline email $!\n";
    ## prep msg for Net:SMTP
    my $msg_body = $msg ->as_string();

    ---- end snip-----
    Now you have an encapsulated html page to insert.

    so now just

    ---- snip 2-----
    $smtp->data();
    $smtp->datasend($msg_body);
    $smtp->dataend();
    $smtp->quit();
    ---- end snip 2 -----

    Now this has been working for me for a long time using Net::SMTP.

    Hope it helps,

    Mike

    "arun" <> wrote in message news:<>...
    > Hi
    > How do i send HTML Mail using Perl Module Net::SMTP_auth. Right now i
    > can able to send the mail but the receipents are able to view all the
    > HTML tags. How to resolve this.
    >
    > With Regards
    > Arun
     
    Mike, Mar 23, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. anya
    Replies:
    16
    Views:
    23,059
    Ben Finney
    May 29, 2006
  2. rote
    Replies:
    8
    Views:
    776
  3. perl_jam

    NET::SMTP_auth error

    perl_jam, Apr 18, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    112
    Fabian Pilkowski
    Apr 18, 2005
  4. Replies:
    1
    Views:
    229
    Uwe Kausch
    Mar 11, 2009
  5. Replies:
    2
    Views:
    90
    Richard Balbat
    Nov 12, 2013
Loading...

Share This Page