Beroc Posted August 22, 2008 Posted August 22, 2008 Hi, I am working on a clients site, got her set up with you guys, as I have had a good experience with you... She is on the dooku server (into starwars names my guess) Here is my problem. I wrote an email function that should email to a person. It doesnt, and fails when trying... I looked over the forums and found that I should be using a -f additional parameter, but that didnt seem to fix it. Any help would be greatly appreciated. >function mailme($to, $subject, $message){ global $fromemailaddress; $headers="MIME-Version: 1.0\r\n"; $headers.="Content-type: text/html; charset=iso-8859-1\r\n"; $headers.="From: $fromemailaddress\r\n"; $headers.="Reply-To: $fromemailaddress\r\n"; $headers.="X-Mailer: PHP/".phpversion(); print "$to\n\n$subject\n\n$message\n\n\n\n$headers\n\n-f$fromemailaddress\n\n\n\n"; if(mail($to,$subject,$message,$headers,"-f$fromemailaddress")){print "Mail Sent";}else{print "Mail Rejected";} } I tested it with a webmaster@mysite.com as well as the actual email address the client is using, but nothing is working. No mail is being sent, and it of course prints Mail Rejected... Quote
TCH-Bruce Posted August 23, 2008 Posted August 23, 2008 It looks ok but maybe this would make it work >$ok = @mail($to, $subject, $message, $headers,"-f$fromemailaddress"); if ($ok) { print "Mail Sent"; } else { print "Mail Rejected"; } Quote
Beroc Posted August 23, 2008 Author Posted August 23, 2008 It looks ok but maybe this would make it work >$ok = @mail($to, $subject, $message, $headers,"-f$fromemailaddress"); if ($ok) { print "Mail Sent"; } else { print "Mail Rejected"; } Hmmm.... I actually dont think it was broke... I may have been stupid and was using some test email that wasnt really an email address. Oh well. it works now. Thanks Quote
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.