prob in mail sendin

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madu
Forum Commoner
Posts: 32
Joined: Sat Dec 25, 2010 3:19 am
Location: india

prob in mail sendin

Post by madu »

hi friends,,,
i am trying to send mail from my local host,,,i am using mamp server and mac os ,,,,
<?php
$host = "smtp.gmail.com";
$username = "easwarsait@gmail.com;
$password = "my mail password";
$FromName = "suresh";
$FromEmail = "msuresh4549@gmail.com";
$ToName = "my friend";
$ToEmail = "karuda74@yahoo.com";
$subject = "hi ,,,,hi";
$body = "sdfds dg dfgfgh fgj fgj ghjj gjgh jghkhgk gjghjhgjgh ";
$from = "suresh<easwarsait@gmail.com>"; // Provide your name and your email address
$to = "balu<karuda74@yahoo.com>";
$headers = array ('From' => $from,'To' => $to,'Subject' => $subject);
$smtp = Mail::factory('smtp',array ('host' => $host,'auth' => true,'username' => $username,'password' => $password)) or die("error in smtp con");
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
}else{
echo("<p>Message successfully sent!</p>");
}
?>
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: prob in mail sendin

Post by Phoenixheart »

...And what are you asking?
Post Reply