Hello Everyone, I setting up a list mailer using mysql and mail::Sender. The mailer uses Subscribed email address and Contact Address.
The mail is suppose to go to the subscribe address. For some reason. It keeps going to the contact address. The code I'm using is below. I tried changing the $new_contact = $pointer->{"Contact"}; to $new_subscribe = $pointer->{"Subscribe"}; and $ito = $new_contact; to $ito = $new_subscribe; When I make this change I can't get the mail to go to the subscribed address. I've tried everything to get this to mail. Can someone tell me what I'm doing wrong? Here's the way I bought the script. It's written like this. $iwhere = ""; if ($type1 eq "FREE") { $iwhere = " WHERE Type = 'FREE'"; } @fields = (Username,Subscribe,Name,Password,Contact,Type,Vacation,Status,Date,Extra1,Extra2,Extra3); &Db_Connect; $SQL = "SELECT * FROM safelist".$iwhere; &Go_SQL; while ($pointer = $sth->fetchrow_hashref) { foreach $field (@fields) { # foreach $field (@fields) { $new_username = $pointer->{"Username"}; $new_contact = $pointer->{"Contact"}; $new_type = $pointer->{"Type"}; } $mline = "======================================================================"; $msg = "$message\n\n". "$mline\n". "$email_note\n\n". "$login_url\n". "<a href=\"$login_url\">Click Here to Login</a>\n". "$mline\n"; $ifrom = $name1. "<".$sub1.">"; $ito = $new_contact; $isubject = $subject; use Mail::Sender; ref ($sender = new Mail::Sender({from => $ifrom,smtp => $smtp_server})) or die "$Mail::Sender::Error\n"; (ref ($sender->MailMsg({to =>$ito, subject => $isubject, msg => $msg})) and print "" ) or die "$Mail::Sender::Error\n"; }