Gossamer Forum
Home : General : Perl Programming :

Mailer Problem

Quote Reply
Mailer Problem
I am using NET::SMTP to send e-mail. The mail is going out ok but the BCC: function is not working and the return address being used is personals\@blackrose.net Any suggestions.


Code:
use NET::SMTP;
$smtp = Net::SMTP->new('mail.blackrose.net'); # connect to an SMTP server
$smtp->mail( 'Personals\@blackrose.net' ); # use the sender's address here
$smtp->to($in{'Mail'}); # recipient's address
$smtp->data(); # Start the mail

# Send the header.
$smtp->datasend("To: $in{'Mail'}\n");
$smtp->datasend("From: Personals\@blackrose.net\n");
$smtp->datasend("BCC: Personals\@blackrose.net\n");
$smtp->datasend("Subject: Your Bondage Personals Access Information\n");
$smtp->datasend("\n");



------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Quote Reply
Re: Mailer Problem In reply to
Not sure if these will help, but I will try. First off, Unix loves to be case sensitive, BCC may not be interpreted right by using BCC. You might try bcc, or Bcc. Just a thought, though reading the docs on NET::SMTP might say otherwise (sorry, I don't have em handy here)..

As for problem 2, very simple, look at the line

$smtp->mail( 'Personals\@blackrose.net' );

You use single right quotes here. Change em to doubles, OR remove the "\" backslash.

Hope this helps



------------------
Fred Hirsch
Web Consultant & Programmer
Quote Reply
Re: Mailer Problem In reply to
I tried it both ways

Test #1
Quote:
$smtp->mail("Personals\@blackrose.net" );

AND
Test #2
Quote:
$smtp->mail( 'Personals@blackrose.net' );

Test #1 worked fine and solved the problem. Test #2 crashed..>;-)

I am sorry I did nto state before. I am on a Win NT server so the case should not be a problem.



------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Quote Reply
Re: Mailer Problem In reply to
I would check the Net::SMTP docs, as I don't think you can specify BCC in the message like that. All recipients must be declared before hand (I think), SMTP doesn't parse the message to pick out the addresses like sendmail -t does.

Cheers,

Alex