Answer the question
In order to leave comments, you need to log in
How to set up sending via PHPMailer?
Hello!
I'm setting up sending emails with attachments via PHPMailer. There are 3 letters. The text is the same everywhere, attachments are different. In two small xlsx, in the third - PDF for 34 megabytes. I send via smtp.mail.ru. What is the problem - when the site is on a local server (I use open server), then everything is OK, all 3 letters go without problems.
When I upload to hosting (I tried timeweb and ihor, dedicated servers are everywhere), only letters with xlsx leave, a letter with PDF returns a 500 error. What am I doing wrong?
The code is the following:
require_once('../PHPMailer/PHPMailerAutoload.php');
$mail = new PHPMailer;
$mail->CharSet = 'utf-8';
$mail->isSMTP();
$mail->Host = 'smtp.mail.ru';
$mail->SMTPAuth = true;
$mail->Username = '***@mail.ru';
$mail->Password = '************';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->setFrom('***@mail.ru');
$mail->addAddress($email);
$mail->addAttachment('../../files/blank_altayeko.xlsx', 'blank_altayeko.xlsx');
$mail->isHTML(true);
Answer the question
In order to leave comments, you need to log in
to find the cause of the error, you should first look at the error logs. On timeweb hosting, logging for the site can be enabled https://hosting.timeweb.ru/logmanager . Files with logs will appear in the project folder next to the public_html folder (in which the site files are located)
Already from the analysis of the logs, it should become clear what is the cause of the error.
memory_limit, max_upload_filesize or something else.
In general, you to the hoster, no directives will correct it for you
tried timeweb and ihor, dedicated servers everywherePlease explain to the ignorant, what is the need to obtain a PDF ???)))
tried timeweb and ihor, dedicated servers everywhere
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question