Hello! I am using phpmailer class to send email and i am attaching a file to the mail. The email is sent successfully but the attachment which is an sql file is empty which should not be the case. I have tried with an image file, but it seems that every file that i attach is empty. Can anyone help me solve this problem please?
$mail = new PHPMailer();
$body = "Reminder";
$mail->IsSMTP();
$mail->Host = "mail.yourdomain.com";
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "
[email protected]";
$mail->Password = "abc";
$mail->SetFrom('
[email protected]',
'blbla');
$mail->AddReplyTo("
[email protected]","First Last");
$mail->Subject = "Your order has been successfully placed"
$mail->MsgHTML($body);
$mail->AddAddress("
[email protected]","xyz");
$mail->AddAttachment("D:\b2\shop3.sql","shop3.sql");
I have tried to display the size of the file before attaching it, and it actually displays the file size. Can anyone help me please?