How can I send e-mail with gmail account
-
I need to send email with gmail account. I tried mail() function but it does not work. Could you help e on this issue? any recommendations are really appreciated :)
you need to set: ini_set(sendmail_from, "youremail@gmail.com"); ini_set(SMTP, "smtpMailServerAddressGoesHere@gmail.com"); ini_set(smtp_port, 25); But I'm not sure what the correct values are.
-
I need to send email with gmail account. I tried mail() function but it does not work. Could you help e on this issue? any recommendations are really appreciated :)
using pear:
<?php
require_once "Mail.php";$from = "Sandra Sender ";
$to = "Ramona Recipient ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";// stick your GMAIL SMTP info here! ------------------------------
$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_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!
");
}
?>from about.com
-
using pear:
<?php
require_once "Mail.php";$from = "Sandra Sender ";
$to = "Ramona Recipient ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";// stick your GMAIL SMTP info here! ------------------------------
$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_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!
");
}
?>from about.com