<?php
require_once("photo_gallery/includes/phpMailer/class.phpmailer.php");
require_once("photo_gallery/includes/phpMailer/class.smtp.php");
require_once("photo_gallery/includes/phpMailer/language/phpmailer.lang-en.php"); $to_name = "name"; // masalan: user
$to = "email address"; //va emaile shoma
$subject = "Mail Test at " . strftime("%T", time());
$message = "This is a test.";
$message = wordwrap($message, 70);
$from_name = "name"; //masalan admin
$from = ""; // va email man
// PHPMailer's Object-oriented approach
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPSecure = 'tls'; //in ro ham emtehan kardam vali bi fayede bood ----> (SSL) va port: 465 -or- (TLS) va port: 587
$mail->Host = "smtp.gmail.com"; // $mail->Host = "ssl://smtp.gmail.com:465"; or "smtp.gmail.com:465"
$mail->Port = 587; // 465 - 587 - 25
$mail->SMTPAuth = true;
$mail->Useame = "useame"; //email: [email protected] // masalan email man
$mail->Password = "password"; // password email
$mail->FromName = $from_name;
$mail->From = $from;
$mail->AddAddress($to, $to_name);
$mail->Subject = $subject;
$mail->Body = $message;
$result = $mail->Send();
echo $result ? 'Sent' : 'Error' . $mail->ErrorInfo;
?>
php مرکز کد های سایت...برچسب : نویسنده : استخدام کار phpco بازدید : 159