dumdumsareyum Posted September 10, 2010 Share Posted September 10, 2010 Hi guys I have a question. I am using the php mail function to send an email from a website. This worked just fine prior (like, immediately prior) to having an ssl certificate installed with my hosting company. Now the mail function returns true (based on my code generating a success message if this condition is met), but no email ever arrives in my inbox. Do I have to change how I am sending the mail? It works the same way if i access the page via http or https. Thanks! Link to comment https://forums.phpfreaks.com/topic/213023-mail-and-ssl/ Share on other sites More sharing options...
Rifts Posted September 10, 2010 Share Posted September 10, 2010 I'm not 100% sure how to do this but I googled around and found these they may help http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm and on a differnent site i found <?php error_reporting(E_ALL); set_time_limit(0); // config -------- $username = '[email protected]'; $password = 'gmail account password'; $to_email = '[email protected]'; // config -------- // path to smtp.php file from XPM2 package require_once '/path/smtp.php'; $mail = new SMTP; $mail->Delivery('relay'); $mail->Relay('smtp.gmail.com', $username, $password, 465, 'autodetect', true); $mail->From($username); $mail->AddTo($to_email); $mail->Text('This e-mail was sent using Gmail Relay SMTP service'); $send = $mail->Send('It is nice to use Gmail Relay'); echo $send ? 'Success' : 'Error'; // for debugging echo '<br>Result: '.$mail->result; ?> Link to comment https://forums.phpfreaks.com/topic/213023-mail-and-ssl/#findComment-1109479 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.