change smtp port from 25 to 587?

前端 未结 5 646
不知归路
不知归路 2021-01-12 12:34

My ISP have blocked port 25 for sending mails from PHP, and instead have allowed port 587 or 465 to be used. how do i force php mail function to use port 587 instead of defa

5条回答
  •  半阙折子戏
    2021-01-12 12:50

    Changing smtp_port only affects how mail() interacts with the server specified by SMTP setting. This isn't the issue. The issue is that:

    1. You are using your local machine as the SMTP server - AND
    2. Your ISP is blocking your local SMTP server (postfix) from relaying messages out to Gmail

    First, read this thread. It discusses the same exact issue. The upshot is that you need to use a different mail server, preferably your ISPs mail server. What server and port does your ISP tell you to use for outbound mail if you want to use their Email services? You should be able to use this from your PHP running locally just like you would an email client like Thundebird - and you will be able to send to Gmail.

提交回复
热议问题