Skip to content

Instantly share code, notes, and snippets.

@ShiponKarmakar
Created August 11, 2018 05:49
Show Gist options
  • Save ShiponKarmakar/5673846eb7a373bc83e9cbe106d1f26e to your computer and use it in GitHub Desktop.
Save ShiponKarmakar/5673846eb7a373bc83e9cbe106d1f26e to your computer and use it in GitHub Desktop.
<?php
require_once "Mail.php";
$from = "Sandra Sender <info@hasmukh.co.in>";
$to = "Ramona Recipient <test@gmail.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "fortune.solidhosting.pro";
$port = "587";
$username = "info@shipon .com";
$password = "8vabTURf%j+G";
$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>");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment