Code Comments
Programming Forum and web based access to our favorite programming groups.Dear my friends...
I am trying to sending an e-mail with Perl::CGI.
But It does not work as I expect. This is the error message:
EHLO command failed: 220 We do not authorize the use of this system to
transport unsolicited,
at cgicgi-akun.cgi line 855
line 855 contains:
$smtp = Net::SMTP::TLS->new(
'mail.penguin-teknologi.com',
# may need a helo parameter here on some servers
Timeout => 9999,
Debug => 0,
);
What is my mistake?
Please tell me.
Thank you very much in advance.
ps: This is the routine.
====
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
use DBI;
use Net::SMTP::TLS;
use MIME::Base64;
......
& kirimemail($mynamalengkap,$myemail,$dasl
ink);
......
sub kirimemail{
my $mymynamalengkap=shift;
my $mymyemail=shift;
my $mymylinknya=shift;
my $mymetaemail=&metaemail($mymyemail);
my $smtpserver="mail.penguin-teknologi.com";
my $smtpport=25;
my $sender="MOHON JANGAN REPLY E-MAIL INI
\<no-reply\@penguin-teknologi.com\>";
my $subject="Please confirm the registration for joining Online-Science.Org
Community";
my $header="X-Mailer";
my $headervalue="Perl sendmail Module 1.09";
my $berkas="akun/konfir-email";
my $user="penguin-teknologi\@penguin-teknologi.com";
my $passwd="*****";
my($smtp,$mailbodydata,%mail);
open(MASUKAN, "<$berkas");
while(<MASUKAN> ){
s/{{NamaLengkap}}/$mymynamalengkap/g;
s/{{Link-nya}}/$mymylinknya/g;
s/{{emailnya}}/$mymyemail/g;
$mailbodydata.=$_;
}
print "<tr><td align=\"center\" valign=\"top\" colspan=2>
<table border=1 cellspacing=0 cellpadding=0 width=400 align=\"center\"
bgcolor=\"purple\">
<tr><td align=\"center\">";
print header;
print start_html("Environment");
print "</td></tr>
</table>
</td></tr>";
#Keep debug off in order for web and email to both work correctly on large
messages
$smtp = Net::SMTP::TLS->new(
'mail.penguin-teknologi.com',
# may need a helo parameter here on some servers
Timeout => 9999,
Debug => 0,
);
$smtp->datasend("AUTH PLAINTEXT\n");
$smtp->response();
# -- Enter sending email box address username below. We will use this to
login to SMTP --
$smtp->datasend(encode_base64("$user"));
$smtp->response();
# -- Enter email box address password below. We will use this to login to
SMTP --
$smtp->datasend(encode_base64("$passwd"));
$smtp->response();
# -- Enter email FROM below. --
$smtp->mail("$sender");
# -- Enter email TO below --
# $smtp->to("$mymetaemail");
$smtp->to("$mymyemail");
$smtp->data();
#This part creates the SMTP headers you see
$smtp->datasend("To: $mymetaemail\n");
$smtp->datasend("From: $sender\n");
$smtp->datasend("Content-Type: text/html \n");
$smtp->datasend("Subject: $subject");
# line break to separate headers from message body
$smtp->datasend("\n");
$smtp->datasend("$mailbodydata");
$smtp->datasend("\n");
$smtp->dataend();
$smtp->quit;
}
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.