EliteDeeds Posted October 30, 2013 Posted October 30, 2013 User: EpicdeeeServer: JohnnySite: epicdeeds.tk Greetings, I am trying to use SMF's email function using PHP, and nothing seems to be going through. No new registration emails, and no direct emails from admin. I ran a few tests on the server, and it's indicated that the mail funtion IS installed. Is there a reason I should not be sending emails out? Below is a test script to test PHP email function. It does go to the 'email sent', however nothing shows up in my mail box. Yes, LOL, I checked my spam folder. Thanks,ED <?php $mail = mail("elitedeeds@outlook.com", "Test","Tester email", "From: Myself<elitedeeds@outlook.com"); if(!$mail){ echo 'mail is not sent!'; } else { echo 'mail is sent :-)'; } ?> This was in my server log. [30-Oct-2013 14:11:54 America/Los_Angeles] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_pgsql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Quote
Byron Posted October 31, 2013 Posted October 31, 2013 I just ran a test from my johnny account and received the email ok. Try this and edit the whoevers. <?php $to = "whoever@gmail.com"; $subject = "Test Email"; $message = "Sending A Test Email."; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $headers .= "From: whoever@heliohost.org" . "\r\n" . "BCC: $maillist\n"; if (mail($to, $subject, $message, $headers)) { echo "<br><p><b>Message successfully sent!</b></p><hr><br>"; echo "From: whoever<br>"; echo "To: Me<br>"; echo "Bcc: $bcc<br>"; echo "Subject: $subject<br>"; echo "Message: $message<br>"; exit; } else { echo "<p>Message delivery failed...</p>"; } ?> Quote
EliteDeeds Posted October 31, 2013 Author Posted October 31, 2013 Flawless!! Thanks a ton!! Everything is working as intended now, even emails sent from the forum. /does happy coder dance Now, if we can just nix those darn 500 errors, we'd be set. Thanks again!!1 Elite Deeds Quote
Recommended Posts