G
G
Gleb Igumnov2015-01-04 17:28:39
PHP
Gleb Igumnov, 2015-01-04 17:28:39

How to send mail with PHPMailer through a remote server?

Good afternoon. A question. There is a site where mail is sent by the PHPMailer 5.2.4 library through a local smtp server. For a number of reasons, the site owners decided to transfer their mail (to which letters from the site go) to mail.ru, the hosting admin claims that the mx record of the domain has been rewritten to the mail.ru server
. In order to send mail through a remote server, the code was given in the following view:

$mail = new PHPMailer;
    $mail->CharSet = 'UTF-8';
    $mail->Host = 'smtp.mail.ru';
    $mail->SMTPAuth = true;
    $mail->Username = '[email protected]';
    $mail->Password = 'ourpassword';
    $mail->SMTPSecure = 'ssl'; 
    $mail->Port = 465;

However, the letters do not go to new mailboxes located on the mail.ru servers, but to the old ones located on the same server as the hosting, the admin claims that everything is ok with DNS, it just sends the script through the local server and therefore goes to local addresses without addressing
An attempt to enter the server, login, password and port in class.phpmailer.php does not lead to anything, when the $Mailer field is changed to smtp in it, the script dies quietly on $Mail->Send() without giving any errors.
The question is, what did I miss / did wrong, or is such a jamb more likely to be connected with the dns settings and do I need to shake the admin further?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Shikanov, 2015-01-04
@dizballanze

You can try to test sending via debugmail

A
Alexander Diunov, 2015-01-04
@adiunov

These are the SMTP server settings. Show the code that calls the send email function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question