troubleshooting Question

Mail in PHP with XAMPP on localhost (windows)

Avatar of NeverEndingFlashStories
NeverEndingFlashStories asked on
Web ServersPHP
9 Comments3 Solutions375 ViewsLast Modified:
Hi,

I am trying to set up mailing using php on my localhost.  
I am not really quite aware what my options are, but a quick search found me sendmail.exe (which hasnt been updated for years, but is included with XAMPP)

Currently, this is what I have :


text.php :
    $to      = 'aaa@gmail.com';
    $subject = 'About localhost';
    $message.="Please...let this work";
    $headers = 'From: xxx@gmail.com' . "\r\n" .
        'Reply-To: xxx@gmail.com' . "\r\n";
    $headers.= "MIME-Version: 1.0\r\n";
    $headers.= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    $headers.= 'X-Mailer: PHP/' . phpversion();
    try {
        mail($to, $subject, $message, $headers);
        echo("hihihihihihi");
    }
    catch (mysqli_sql_exception $e){
        echo ("hahahahahaha");
        echo "well this didnt work out" . $e;
    }


php.ini :

SMTP = smtp.gmail.com
smtp_port = 465
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header=Off

sendmail.ini :

smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
error_logfile=error.log
debug_logfile=debug.log
auth_username=xxx@gmail.com
auth_password=xxx
pop3_server=
pop3_username=
pop3_password=
force_sender=xxx@gmail.com
force_recipient=
hostname=smtp.gmail.com


I have also modified the properties of sendmail.exe so that it is running under administrative mode, with compatibility setting for windows xp sp 3

The result I am getting on the page is as follows

UAC opens up, requesting permission to run sendmail.exe
once I give the permission, sendmail.exe opens up a blank command prompt window
The website keeps loading, waiting for some sort of response from sendmail.exe.

Then nothing happens. The sendmail.exe command prompt never changes.

Any suggestions?
Or maybe a different solution to sendmail?

Thank you
ASKER CERTIFIED SOLUTION
NeverEndingFlashStories

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros