I am trying to send a mail message to a Lotus SMTP mail server and the code is below. My problem is that the Mail gateway is stopping the message becuase the from account is not valid is thinks it is from postmaster@hhamiwovts although I do set the from account. I have set verbose debuggin on and got the following output. Can I fix this or do I have use a different method ?
output Net::SMTP=GLOB(0xbbc028)<<< 220 hsbcib.com MAILsweeper ESMTP Receiver + Version 4 .2.5.0 Ready Net::SMTP=GLOB(0xbbc028)>>> EHLO localhost.interwoven.com Net::SMTP=GLOB(0xbbc028)<<< 250-hsbcib.com Net::SMTP=GLOB(0xbbc028)<<< 250-SIZE 0 Net::SMTP=GLOB(0xbbc028)<<< 250-ETRN Net::SMTP=GLOB(0xbbc028)<<< 250-ENHANCEDSTATUSCODES Net::SMTP=GLOB(0xbbc028)<<< 250-DSN Net::SMTP=GLOB(0xbbc028)<<< 250-VRFY Net::SMTP=GLOB(0xbbc028)<<< 250-AUTH Net::SMTP=GLOB(0xbbc028)<<< 250 8BITMIME Net::SMTP=GLOB(0xbbc028)>>> MAIL FROM:<postmaster@HHAMIWOVTS> Net::SMTP=GLOB(0xbbc028)<<< 250 2.0.0 postmaster@hhamiwovts OK Net::SMTP=GLOB(0xbbc028)>>> RCPT TO:<leeablett@hotmail.com> Net::SMTP=GLOB(0xbbc028)<<< 250 2.0.0 leeablett@hotmail.com OK Net::SMTP=GLOB(0xbbc028)>>> DATA Net::SMTP=GLOB(0xbbc028)<<< 354 Ready for data Net::SMTP=GLOB(0xbbc028)>>> Subject: HSBC Asset Management (Europe) In +ternet Sit e Update Net::SMTP=GLOB(0xbbc028)>>> SMTPOriginator: Andrew.Webster@hsbcam.com Net::SMTP=GLOB(0xbbc028)>>> To: leeablett@hotmail.com Net::SMTP=GLOB(0xbbc028)>>> From: Andrew.Webster@hsbcam.com Net::SMTP=GLOB(0xbbc028)>>> MAIL FROM: Andrew.Webster@hsbcam.com Net::SMTP=GLOB(0xbbc028)>>> Content-Type: text/plain; charset=UTF-8 Net::SMTP=GLOB(0xbbc028)>>> Return-Path: Andrew.Webster@hsbcam.com Net::SMTP=GLOB(0xbbc028)>>> Date: Thu 21 Nov 2002 16:36:50 GMT Net::SMTP=GLOB(0xbbc028)>>> X-Mailer: Mail::Mailer[v1.18] Net::SMTP[v2 +.15] sub sendMail{ my ($emailAddress,$title,$firstName,$surname,@mailSets) = @ +_; #===================================================================== # Construct date header #===================================================================== my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time +); $year += 1900; $mon = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[ $mon ] +; $wday = (qw(Sun Mon Tue Wed Thu Fri Sat))[ $wday ]; my $date = "$wday $mday $mon $year $hour:$min:$sec GMT"; debug("Mail set : @mailSets"); my($mailer) = new Mail::Mailer('smtp', Server => $mailServer); my(%headers) = ( 'SMTPOriginator' => $siteMessageFrom, 'To' => $emailAddress, "Return-Path" => $siteMessageFrom, 'From' => $siteMessageFrom, 'MAIL FROM' => $siteMessageFrom, 'Subject' => $siteMessageSubject, 'Date' => $date, 'Content-Type' => 'text/plain; charset=UTF-8', ); #=#================DEBUGGING foreach my $k (sort(keys(%headers))){ if (ref($headers{$k}) eq "ARRAY"){ foreach my $e (@{$headers{$k}}){ #debug("$k ==> $e"); } } else { #debug("$k => $headers{$k}"); }} my $message = $siteMailTemplate; my $messageSet; foreach my $set (@mailSets){ $messageSet .= "$setName{$set}\t\t$setFullURL{$set} \n"; } $message =~ s/\$\$sections/$messageSet/g; $message =~ s/\$\$title/$title/g; $message =~ s/\$\$surname/$surname/g; $message =~ s/\$\$firstName/$firstName/g; #debug($message); $mailer->open(\%headers); print $mailer $message; #$mailer->close; }

In reply to Lotus SMTP by lablett

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.