|
Posted by harryfmudd [AT] comcast [DOT] on February 11, 2006, 6:43 pm
Please log in for more thread options
Frank J. Russo wrote:
> Copied the below code straight from a web source (
> http://alma.ch/perl/Mail-Sendmail-FAQ.html#HTML ) on sending html emails w/
> PERL. The ONLY change I made was to put GOOD email addresses in the TO /
> From
>
> I am getting the following errror and need help?
>
> ---------Error: RCPT TO: error (550 relay not permitted) -------------
>
> =======================================
> use MIME::QuotedPrint;
> use HTML::Entities;
> use Mail::Sendmail 0.75; # doesn't work with v. 0.74!
>
> $boundary = "====" . time() . "====";
>
> $text = "HTML mail demo\n\n"
> . "This is the message text\n"
> . "Voilà du texte qui sera encodé\n";
>
> %mail = (
> from => 'me@annunciationparish.org (webmaster)',
> to => 'my@yahoo.com (Frank)',
> subject => 'Test HTML mail',
> 'content-type' => "multipart/alternative; boundary=\"$boundary\""
> );
>
> $plain = encode_qp $text;
>
> $html = encode_entities($text);
> $html =~ s/\n\n/\n\n<p>/g;
> $html =~ s/\n/<br>\n/g;
> $html = "<p><strong>" . $html . "</strong></p>";
>
> $boundary = '--'.$boundary;
>
> $mail = <<END_OF_BODY;
> $boundary
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> $plain
>
> $boundary
> Content-Type: text/html; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <html>$html</html>
> $boundary--
> END_OF_BODY
>
> sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";
>
> ============================================
>
>
Your SMTP server is not configured to relay mail. Contact the
administrator of that server, or use another server.
Tom Wyant
|