0

When a user creates an account he automaticcly gets an email with his username and password.

$msg = "Hello '$username'\nLogin Data:\n\nUsername: '$username'\nPassword: '$password'\n\nThank you for registering here!";
// Send mail
$to = $email;
$subject = "Welcome";
$headers = "From:mail@gmail.com\r\n";
mail($to, $subject, $msg, $headers);
header("refresh:5;url=../index.html");
echo 'Registration successful. You\'ll be redirected in about 5 seconds. If not, click <a href="../index.html">here</a>.';

php.ini

 SMTP = smtp.gmail.com
 smtp_port = 25
 sendmail_from = email@gmail.com
 sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
 sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"

sendmail.ini

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

Did I do something wrong ? :)

Andrei Olar
  • 2,270
  • 1
  • 15
  • 34
  • what's inside the `c:\xampp\mailoutput` file ? – Alex Andrei Dec 31 '15 at 18:42
  • To: mail@gmail.com Subject: Welcome From:mail@gmail.com Hello 'user' Login Data: Username: 'user' Password: 'pass' Thank you for registering here! – Andrei Olar Dec 31 '15 at 18:46
  • You are overwriting the value of `sendmail_path` in `php.ini` setting it to use the `mailtodisk` utility. Which is working quite well. Remove this line `sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"` and you should be ok – Alex Andrei Dec 31 '15 at 23:28

0 Answers0