darkcarnival Posted June 16, 2006 Share Posted June 16, 2006 hello,after phpmailer has not met my needs, i decided to try pear's version of a mailing solution.and I'm using the sendmail approach since my host recommends that.now i wish to use it in a loop form for my newsletter system but in my testing the emails did not send but i got no error message. not sure if i screwed up or if its not ment to used that way but heres my code.[code] #form data.$name = $_POST['name'];$email = $_POST['email'];$comment = $_POST['comment'];#send email.require("Mail.php");#get values for class.$headers['From'] = $email;$headers['Subject'] = 'Mail Test';$params['sendmail_path'] = '/usr/bin/sendmail';// Create the mail object using the Mail::factory method$mail_object =& Mail::factory('sendmail', $params);#create a message$message = "Hello,$name has sent you a message:$comment";$body = $message;#query time.$q = mysql_query("select * from demo_list");while($r = mysql_fetch_assoc($q)){$recipients = $r['Email'];$headers['To'] = $r['Email'];$mail_object->send($recipients, $headers, $body);}echo "Email has been sent to the desired location.";[/code]I really hope someone can help me with thisbtw before you ask, yes im 100% sure the sendmail path is correct.thanks. Quote Link to comment https://forums.phpfreaks.com/topic/12165-need-help-with-mail-class-from-pear/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.