0

websiteI want my website to automatically generate an email to be sent to a customer when they click the submit button.

I have added the following php:

$subject = "Thank You";
$message = "Thank you .........";
$from = "[email protected]";
$headers = "From:" . $from;
mail($email, $subject, $message, $headers);

The variable $email was defined earlier. Also I have edited my php.ini to include the following:

SMTP = smtp.mywebsite.com
smtp_port = 25
username = [email protected]
password = password
sendmail_from = [email protected]

Clearly I have not done enough. What more do I need to do?

CTViking
  • 99
  • 1
  • 5

1 Answers1

0

This question is duplicate with Sending email with PHP from an SMTP server

PHP mail function has some issue with smtp. (It is not support for smtp user name and password) Use 3rd party mail library like Swift mailer, PHPMailer, etc...

Community
  • 1
  • 1
Dinuka Thilanga
  • 4,220
  • 10
  • 56
  • 93