-1

This is the mail that should send (code in my PHP):

$message = 
"Hello \n
Thank you for registering with us. Here are your login details...\n

User ID: $user_name
Email: $usr_email \n 
Passwd: $data[pwd] \n

";

mail($usr_email, "Login Details", $message,
"From: \"Member Registration\" <xxxx@gmail.com>\r\n" .
"X-Mailer: PHP/" . phpversion());

header("Location: thankyou.php");  
exit();

and my sendmail.ini

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=25
error_logfile=error.log
debug_logfile=debug.log
auth_username=xxxx@gmail.com
auth_password=xxxxxxx
force_sender=xxxx@gmail.com

I'm a complete beginner so this could be totally wrong. When I submit the form where the mail function is, the thankyou.php page appears as specified

user1296762
  • 512
  • 2
  • 7
  • 21
  • 5
    Gmail does not accept mail on port 25. It has to be SSL/TLS on port 587. – Michael Berkowski Mar 29 '12 at 20:28
  • 2
    See [this](http://stackoverflow.com/questions/712392/send-email-using-gmail-smtp-server-from-php-page), among [many others](http://stackoverflow.com/search?q=gmail+smtp+%5Bphp%5D&submit=search).... – Michael Berkowski Mar 29 '12 at 20:29

2 Answers2

0

Try phpMailer. You're not forming the mail properly to be acceptable by google... use this class to send a standard mail.

Sujit Agarwal
  • 12,348
  • 11
  • 48
  • 79
0

It won't work because GMail is using different SMTP ports with SSL, and you are using the port 25.

You should try some website found on Google to find out how to set your SMTP server properly with sendmail, like this one : http://appgirl.net/blog/configuring-sendmail-to-relay-through-gmail-smtp/

Axel Isouard
  • 1,498
  • 1
  • 24
  • 38