Корче говоря я пользовался модулем MAil::Sendmail. Вот рабочий пример| Код | use Mail::Sendmail;
%mail = ( To => '[email protected]', From => '[email protected]', Subject => 'Subj', 'Content-Type' => 'text/plain; charset=win1251', 'Content-Transfer-Encoding' => '8bit', Message => 'Ура! Работает!');
$mail{Smtp} = 'smtp.mail.ru'; sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
| Можно и с аттачем.| Код | use MIME::QuotedPrint; use MIME::Base64; use Mail::Sendmail;
$message = qq[<html><body><h1>Вот то, что просила</h1><img src="pbar.gif><img src="erorr.gif></body></html>]; $message = encoder($message,"win","koi"), $boundary = "====" . time() . "====";
%mail = ( To => '[email protected]', From => '"Bill Gates" <[email protected]>', Subject => 'Subj', 'Content-Type' => "multipart/mixed; boundary=\"$boundary\" charset=koi8-r", 'Content-Transfer-Encoding' => '8bit', 'X-Mailer' => 'Microsoft Outlook Express 6.00.2600.0000', smtp => 'your smtp server', 'X-MSMail-Priority' => 'High');
$file = 'send.pl'; #Здесь пишешь название файла, которы отправляешь. $mail{body} = encode_base64(<F>); close F;
$boundary = '--'.$boundary; $mail{body} = <<END_OF_BODY; $boundary Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: 8bit
$message $boundary Content-Type: application/octet-stream; name="$file" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="$file"
$mail{body} $boundary--\n END_OF_BODY
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log; | Шли чо хочешь куда хочешь. |