Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php mailer is not sending mail to yandexmail,gmail,hotmail systems. but mail is sending to 10 miniute email system #2177

Closed
remzimete opened this issue Oct 22, 2020 · 15 comments

Comments

@remzimete
Copy link

    $mail = new PHPMailer();

    //SMTP Settings
   # $mail->isSMTP();

(when $mail->isSMTP(); active i am getting error.)

There are websites in internet the form of 10 miniute e-mails(like : https://10minutemail.com/), the email is send to 10 miniute e-mails but whenever I try to send e-mails to systems such as yandex and gmail, it does not come in any way (I getting a message as sent. "echo "Email is sent!";"

sir, i am gonna be insane

    $mail->SMTPDebug  = 2;
    $mail->Host = "smtp.yandex.com";
    $mail->SMTPAuth = true;
    $mail->CharSet = 'UTF-8';
    $mail->Username = "admin@x.com";
    $mail->Password = 'x';
    $mail->Port = 465;
    $mail->SMTPSecure = "ssl"; 

    //Email Settings

    $mail->isHTML(true);
    $mail->setFrom("admin@x.com",$language_translate["mailbot"]);
    $mail->addAddress($uye_eposta);
    $mail->addAddress('x@hotmail.com');
    $mail->addAddress('x@gmail.com');
    $mail->addAddress('admin@x.com');
    $mail->addReplyTo('admin@x.com', 'Adınız');
    $mail->Sender = "admin@x.com";
    $mail->addCustomHeader('X-custom-header', 'custom-value');
    $mail->Subject = "x.com ".$language_translate["mailverify"];
    $mail->Body = "

editing..
düzenleniyor...

please click here hey :

click
";

    if ($mail->send()) {
        $status = "success";
        echo "Email is sent!";
    } else {
        $status = "failed";
     echo   "Something is wrong: <br><br>" . $mail->ErrorInfo;
    }
@Synchro
Copy link
Member

Synchro commented Oct 22, 2020

If you disable SMTP sending, you'll get no SMTP debug output. You say "am getting error", but I can't help if you don't show what the errors are.

@XL-2000
Copy link

XL-2000 commented Oct 22, 2020

Please provide the debug output! Without any detailed input it is hard to guess...
Also, please check if you are using the correct port number (it could be 587 instead of 465)

@remzimete
Copy link
Author

when i am disable smtp
e-mail sending to 10 miniute email systems but it's not coming to gmail,hotmail system

so the port is 465 is working. but i am gonna try for you 587 or not. now

i am gonna active smtp and then i will show you what it's coming as error.

@remzimete
Copy link
Author

i tried 465 and 587 port
the ports is working you can try 465 and 587 email sending to 10 miniute email systems. but not sending to hotmail-gmail..

now i am trying "smtp active"

    $mail->isSMTP();

    $mail->SMTPDebug  = 2;

Unti1241241241412tled

@remzimete
Copy link
Author

$mail->isSMTP();

$mail->SMTPDebug  = 1;

Screenshot_2

@Synchro
Copy link
Member

Synchro commented Oct 22, 2020

You can only use ssl mode with port 465, and tls mode with port 587. For debugging, I recommend using tls mode, and set SMTPDebug = 3.

@remzimete
Copy link
Author

    $mail->isSMTP();
    $mail->SMTPDebug  = 3;
    $mail->Port = 587; 
    $mail->SMTPSecure = "tls";

Screenshot_3

@Synchro
Copy link
Member

Synchro commented Oct 22, 2020

Right, so your server's hosting provider is blocking outbound SMTP. They probably provide an alternative means of sending email (e.g. via their own servers), or may remove the SMTP block if you ask – but this is down to them, not your script or PHPMailer. This is also covered in the troubleshooting guide that's linked from all your error messages.

@Synchro Synchro closed this as completed Oct 22, 2020
@remzimete
Copy link
Author

hello dear human.

the host provider has opened the smtp block.

but

i am still getting error ;

                                        $mail = new PHPMailer();
                                      #  IsSMTP(); böyle bir class yok dedi haliyle göremedi.. attığın siteden copy paste yaptık.
                                        $mail->isSMTP();
                                        $mail->SMTPDebug = 3; // hata ayiklama: 1 = hata ve mesaj, 2 = sadece mesaj
                                        $mail->SMTPAuth = true;
                                        $mail->SMTPAutoTLS = true;
                                        $mail->SMTPSecure = 'tls'; // Güvenli baglanti icin ssl normal baglanti icin tls
                                        $mail->Host = "smtp.yandex.com"; // Mail sunucusuna ismi
                                        $mail->Port = 587; // Guvenli baglanti icin 465 Normal baglanti icin 587
                                        $mail->IsHTML(true);
                                        $mail->SetLanguage("tr", "phpmailer/language");
                                        $mail->CharSet ="utf-8";
                                        $mail->Username = "admin@x.com"; // Mail adresimizin kullanicı adi
                                        $mail->Password = "x"; // Mail adresimizin sifresi
                                        $mail->SetFrom("admin@x.com", "Isim"); // Mail attigimizda gorulecek ismimiz
                                        $mail->addAddress('xxxn@hotmail.com'); // Maili gonderecegimiz kisi yani alici
                                        $mail->Subject = "Mesaj Basligi"; // Konu basligi
                                        $mail->Body = "Mesaj icerigi"; // Mailin icerigi
                                        if(!$mail->Send()){
                                            echo " HATAMIZ BURADA...           HEY: ".$mail->ErrorInfo;
                                        } else {
                                            echo "Mesaj gonderildi";
                                        }

image

@remzimete
Copy link
Author

I've been feeling stupid for 3-4 days
taking the same a lot of mistakes.

image

i tried a lot of combinasion&test

:(

@Synchro
Copy link
Member

Synchro commented Oct 22, 2020

It still looks like your connections are being blocked. I suggest you try using the tests described in the troubleshooting guide, such as using telnet or openssl to check connections; This will eliminate PHP as a source of your problem.

@remzimete
Copy link
Author

                                        echo (extension_loaded('openssl') ? 'SSL loaded' : 'SSL not loaded') . "\n";

i have not access for telnet

openssl
ssl loaded

image

@Synchro
Copy link
Member

Synchro commented Oct 22, 2020

I mean start here. If your host is blocking SMTP (and it still looks like they are), nothing that you do in your script will make any difference. You could try seeing if you can connect to other servers, such as smtp.gmail.com (it doesn't matter if you don't have an account, you just want to see if it will connect at all).

Read the PHPMailer docs I've pointed you at, read your hosting provider's docs, report this issue to them. Beyond that there's nothing I can do.

@remzimete
Copy link
Author

image
Thanks for your time.
i am gonna stay at contact with hosting provider.

all best,
From Turkey
Remzi Mete

@remzimete
Copy link
Author

The problem is about the hosting company.

They are blocking smtp and then they said to me.
go to sendpulse and then you will get smtp you will use in there.

i did everything dkim,spf settings vs.....

but the problem is SAME!

i mean :

if you are gonna do a project DON 'T BUY CHEAP HOSTİNG.

i was paying 30TL per year
30 TL / 3.69 $
DON'T DO THİS. idk abroad companies
but in turkey almost every hosting companies they are BAD!

i am 16 years old.
if was i have money.
if i mean if i could i would. for donate to you :)

thanks for everything.
All best,
Remzi Mete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants