Hi,
I tried to send a mail with PHPMail class. Its sending properly if i write the attachment file name directly( I have mentioned my code bellow)
[code=php]
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "192.168.111.11 1";
$mail->SMTPAuth = true;
$mail->Username = "";
$mail->Password = "";
$mail->From = "test@yahoo.com ";
$mail->FromName = "Mailer";
$mail->AddAddress("te st@yahoo.com"," TestName");
$mail->WordWrap = 50;
$mail->AddAttachment( "test.doc") ;
$mail->IsHTML(true) ;
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
[/code]
If i get the file name from previous page its shows an error Language string failed to load: file_access'/tmp/phpNcvep9'.
How can i solve this problem.
Thanks.
I tried to send a mail with PHPMail class. Its sending properly if i write the attachment file name directly( I have mentioned my code bellow)
[code=php]
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "192.168.111.11 1";
$mail->SMTPAuth = true;
$mail->Username = "";
$mail->Password = "";
$mail->From = "test@yahoo.com ";
$mail->FromName = "Mailer";
$mail->AddAddress("te st@yahoo.com"," TestName");
$mail->WordWrap = 50;
$mail->AddAttachment( "test.doc") ;
$mail->IsHTML(true) ;
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
[/code]
If i get the file name from previous page its shows an error Language string failed to load: file_access'/tmp/phpNcvep9'.
How can i solve this problem.
Thanks.
Comment