How to implement this code to send html content
"; $to = "TargetName "; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "mail.mailserver.com"; $username = "name@myemail.com"; $password = "my_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("" . $mail->getMessage() . "
"); } else { echo("Message successfully sent!
"); } ?>
Send Email From PHP Using SMTP Authentication (Guide)
Please sign in to leave a comment.
Comments
0 comments