Hello.
May I please request assistance with regards sending mail via smtp?
I've written so far, for a basic test:-
However I can't get it to work. The site log seems to report there's any error with the line I've coloured above.
Could someone please spot where I'm going wrong, or should I just change hosts, if everything looks ok?
Thank You.
May I please request assistance with regards sending mail via smtp?
I've written so far, for a basic test:-
<?php
$from = "noreply@happyappi.com";
$to = "test@outlook.com";
$subject = "Test email using PHP SMTP";
$body = "This is a test email message";
$host = "server.eukhost.co.uk";
$port = "587";
$username = "noreply@happyappi.com";
$password = "wcooC~~*tyU";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent....!!</p>");
}
?>
However I can't get it to work. The site log seems to report there's any error with the line I've coloured above.
Could someone please spot where I'm going wrong, or should I just change hosts, if everything looks ok?
Thank You.