in reply to Mail::SendMail Content -type setting

Hi,

you can pass any SMTP headers as a key-value pair ( hash ) as given below, to Mail::Sendmail

use Mail::Sendmail; %mail = ( To => 'you@there.com', From => 'me@here.com', Content-Type => 'text/html' Message => "This is a very short message" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log;
If you want to send a mail with attachment, you can specify Content-Type as multipart/mime and boundary. You can also send headers like Content-Disposition, Content-Transfer-Encoding etc in the same way.

Cheers !

--VC



There are three sides to any argument.....
your side, my side and the right side.

Replies are listed 'Best First'.
Re^2: Mail::SendMail Content -type setting
by narainhere (Monk) on Aug 27, 2007 at 05:10 UTC
    ya but I am working on an existing code (which was written by some DUD) and I can't afford the luxury of changing that code too much.I am presenting a similar code here,
    $sm = new SendMail('Server Name'); $sm->From('aa@bb.com'); $sm->To('xx@yy.com'); $sm->Subject('just kill me'); $str="<HTML><strong>This is mail body</strong></HTML>"; $sm->setMailBody($str); $sm->sendMail();
    Is there any way(any sub-routine) of specifying the content-type over here??? just like the mail body and from and to addresses
      I does not seem like you are using Mail::Sendmail as suggested above in this thread. The code you provided looks a lot like the synopsis for Net::DNS::Sendmail. From looking at the source code, it does not seem to support setting the Content-Type.
      --
      Andreas
        Hey buddy thanks for that, Actually I am using the module Mail::SendMail not Mail::Sendmail Module.

        And I believe it is not in CPAN, I should find out which guy over here wrote that module.