Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mime::Lite and mailing list

Status
Not open for further replies.

monrow

Technical User
Apr 22, 2008
29
FR
Hi all,

This my code :
Code:
my $dest = 'list_diffusion@gmail.com';
my $object = "TEST";
my $from = "benoit.lacoutre@gmail.com";
my $message = "TEST";


my $Mails = new MIME::Lite 
   From => $from, 
   To => $dest, 
   Cc => '', 
   Bcc =>'', 
   Subject =>$object, 
   Type =>'multipart/mixed',

Data => "$message";

$Mails->attr("content-type" => "text/html; charset=iso-8859-1");

$Mails->send;

'list_diffusion@gmail.com' is a mailing list;
I don't understand why when i use this script,
benoit received the mail and the mailing list didn't receive the mail.

When i use outllok for sending a mail to the mailing list,it's run.

Can you help me ?
How can i trace it ?


Thanks

 
But how do you send the email, where is your smtp-server declared?
 
at minimum, this line is wrong:

Code:
my $from = "benoit.lacoutre@gmail.com";

use single-quotes around the right side otherwise perl will think @gmail is an array and try and expand it into a string. You could alternately escape the @ symbol: \@, but using single-quotes is the better method.

Code:
my $from = 'benoit.lacoutre@gmail.com';

Hopefully that clears up the problem.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top