Trying to send an activation email for newly registered users, here’s the code so far:
$to = $email;
$subject = "Activate your account!";
$headers = "From: noreply@test.com";
$body = "..."
$mail($to, $subject, $body, $headers);
In the tutorial by phpacademy, the instructor used
ini_set("SMTP", $server);
I cannot figure out what to do. I think that my SMTP server should be my Yahoo account. How can I send the emails?
If you are going to sending email with PHP mail function you have to setup a SMTP server first in your PC. Other way, you can use a class to do this with out setting any thing in your PC. PHP mailer known to do this with few lines:
here is an example from the site of the project:
Official web site: http://phpmailer.worxware.com