Jump to content

[SOLVED] mail() in php


cyber_ghost

Recommended Posts

its been 2 days of searching the reasons... why does mail() in php cant send email to other web server (e.g. yahoo, gmail, etc), but nobody gives me a details infos.. about this matter......?

 

 

anyway this is my first time in taking the mail function......

 

does any body here knows the reasons why does this dump thing happening?

 

im current using xampp, with mercury32 as a mail server....

 

thank you in advance...

 

 

 

 

 

 

Link to comment
Share on other sites

ok here is my code:

 

<?php

 

$to = "zoid_active_core@yahoo.com";

$message = "this is a test";

$subject = "mail testing";

 

 

if(mail($to,$subject,$message,"From: zoid_active_core@yahoo.com"))

echo "sent";

 

else

  echo "not sent";

 

?>

 

---- it just display "sent", but when i gonna check my email account....... theres none...

 

the mercury when disabled displayed " Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\fatmalaboo\html\ordering\submitting_order.php on line 20"

 

 

 

Link to comment
Share on other sites

I see you're sending this from your own server on xamp.  I'm pretty sure that xamp doesn't include an SMTP server as standard, so make sure you get one installed otherwise it isn't going to work at all.

 

I get this same issue when testing scripts that try send e-mails, but they work fine once they're uploaded to my webspace.

 

Maybe someone can recommend a good SMTP server to try, but I'm sure google will give you some free programs out there.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.