1

I have a issue sending email with postfix + php7. I press button to send email and I get it, but sometimes mail is not arrived, clicking in the same button. After a while or few minutes I'm tried to send email and works.

This is the php code to send email on the server side, I'm using ajax.

 $message = "<!DOCTYPE html>
            <html>
                <head>

                    <meta charset='UTF-8'>
                    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
                    <style> 

                        .dataClass{
                            font-size: 14px;
                            font-weight: bold;
                        }</style>

                </head>
                <body>
                    test email dealer processing
                </body>
            </html>
            ";


            $headers =                   
            'MIME-Version: 1.0' . "\r\n".
            'Content-type: text/html; charset=iso-8859-1' . "\r\n".
            'From: ScanChex <admin@scanchex.net>' . "\r\n".
                        'Reply-To: ScanChex <admin@scanchex.net>' ."\r\n";




            $sent  = mail($email, 'Welcome To ScanChex dealer ', $message, $headers);

This is the response when email is sent ok in /var/log/mail.log

****Aug 27 00:28:46 localhost postfix/smtp[9308]: 0C0C9122A00: to=<delstonetest@gmail.com>, relay=gmail-smtp-in.l.google.com
[108.177.98.27]:25, delay=0.27, delays=0/0.01/0.07/0.19, dsn=2.0.0, status=sent (250 2.0.0 OK 1503793726 v37si5208238plg
.629 - gsmtp)****

This is the response in /var/log/mail.log when emails is not sent

**Aug 27 00:31:37 localhost postfix/local[9358]: 6F8BC122A09: to=<scanchex@scanchex.net>, orig_to=<www-data@scanchex.net>,
 relay=local, delay=0.01, delays=0/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 27 00:31:37 localhost postfix/qmgr[27663]: 6F8BC122A09: removed**

I don't understand why "to" change to <www-data@scanchex.net> or <scanchex@scanchex.net> when is the same process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.