-5

I have a strange problem on my server.php mail() function does not send emails.What are the first steps to trouble shoot this? What can I do? this is my php.ini values for reference :

SMTP: localhost,
smtp_port:25,
sendmail_from:no value,
sendmail_path:/usr/sbin/sendmail -t -i

thnx in advance.

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
Aniket
  • 8
  • 2

2 Answers2

0

You need to setup a mail server on your machine for the mail function to work. If you are on Windows (which I am guessing you are from your use of WAMP) you can setup a Pegasus mail server.

Other options include using a wrapper class such as SwiftMailer or PHPMailer and using them to connect to another SMTP server such as your GMail account. Even if you go the Pegasus mail server on your own localhost route then I would still recommend using one of the two classes I have mentioned above. They give you far more flexibility and are safer.

Connecting to either your ISPs SMTP server or GMail or whatever is the easiest route out of this one.

Prashant Tapase
  • 2,132
  • 2
  • 25
  • 34
0

Try to use gmail's smtp server.

smtp address: ssl://smtp.gmail.com
smtp port: 465
smtp username: your_gMail_username
smtp password: your_gMail_password
Kyle Emmanuel
  • 2,193
  • 1
  • 15
  • 22