ممنون از اینکه با حوصله جواب مارو میدین.
فکر کنم آموزش خوبی هم ازش در بیاد برای کسانی که نیاز دارن.
از این روش که شما میگین طی جستجویی که بنده داشتم این کدهارا پیدا کردم...
کد HTML:
<?php
require_once('../class.phpmailer.php');
include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
include("language/phpmailer.lang-en.php");
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->Host       = "smtp.gmail.com"; // SMTP server
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "tls";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
$mail->Username   = "Milad0661@gmail.com";  // GMAIL username
$mail->Password   = "123456";            // GMAIL password
$mail->AddReplyTo('Milad0661@gmail.com', 'First Last');
$mail->AddAddress('sbloominent30@gmail.com', 'John Doe');
$mail->SetFrom('Milad0661@gmail.com', 'First Last');
$mail->AddReplyTo('Milad0661@gmail.com', 'First Last');
$mail->Subject = 'sefaresh jadid';
$mail->AltBody = 'yek sefaresh jadid'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif');      // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK<P></P>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
این کد رو در یک فایل php با نام phpmailer ذخیره کردم و در فایل index هم به این گونه
کد HTML:
<form action="phpmailer.php" enctype="multipart/form-data" method="post" style="display: bock">
درست انجام دادم؟؟