i have this function code
require_once("../includes/classMail/class.smtp.php");
require_once("../includes/classMail/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = $_SESSION['MailHost']; // SMTP servers
// sender
$mail->From = $_SESSION['UserEmail'];
$mail->FromName = $_SESSION['UserName'];
// receiver
unset($ArrExp);
$ArrExp=explode(",",$EmailTo);
for ($i=0;$i<count($ArrExp);$i++) {
$mail->AddAddress($ArrExp[$i],"");
}
if($EmailCC!="")
{
// CC to
unset($ArrExp);
$ArrExp=explode(",",$EmailCc);
for ($i=0;$i<count($ArrExp);$i++) {
$mail->AddCC($ArrExp[$i],"");
}
}
// ReplyTo
$mail->AddReplyTo("$_SESSION[UserEmail]","$_SESSION[UserName]");
// attachement File
$TxtAttach=explode("{:}",$TxtAttach);
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("../images/logoletter/$EmailAttach"); // attachment1
for ($i=0;$i<count($TxtAttach);$i++)
{
$TxtAttach2=explode("{..}",$TxtAttach[$i]);
// attachment2
$mail->AddAttachment("../upload/$TxtAttach2[0]");
}
$mail->IsHTML(true); // send as HTML
$mail->Subject = $EmailSubject;
$mail->Body = $EmailBody;
$mail->AltBody = "";
if(!$mail->Send())
{
return $mail->ErrorInfo;
} else {
return 1;
}
this function work perfectly for my company mail, but i can't send to gmail / yahoo mail using this function and no error show up
How i can fix this so i can send mail to gmail/yahoo or other mail. Thanks