将smtp端口从25改为587? [英] change smtp port from 25 to 587?

查看:1582
本文介绍了将smtp端口从25改为587?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ISP已阻止端口25从PHP发送邮件,而是允许使用端口587或465。我如何强制php邮件功能使用端口587而不是默认25? BTW:我在OSX 10.6.6使用MAMP PRO

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 default 25? BTW : i am on OSX 10.6.6 using MAMP PRO

更新:我尝试将php.ini中的设置更改为此

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 587

因为我在mac我不要以为这可以是我的解决方案,而且我试过不行。它给我以下错误消息。

as i am on mac i don't think this can be the solution for me, and it is not working after i tried. it gives me following error message.

May  6 20:32:25 Ibrahim-Armars-MacBook-Pro postfix/smtp[2822]: connect to alt2.aspmx.l.google.com[74.125.159.27]:25: Operation timed out
May  6 20:32:25 Ibrahim-Armars-MacBook-Pro postfix/smtp[2823]: connect to alt2.aspmx.l.google.com[74.125.159.27]:25: Operation timed out
May  6 20:32:25 Ibrahim-Armars-MacBook-Pro postfix/smtp[2827]: connect to alt2.aspmx.l.google.com[74.125.159.27]:25: Operation timed out
May  6 20:32:25 Ibrahim-Armars-MacBook-Pro postfix/smtp[2825]: connect to alt2.aspmx.l.google.com[74.125.159.27]:25: Operation timed out
May  6 20:32:25 Ibrahim-Armars-MacBook-Pro postfix/smtp[2828]: connect to alt2.aspmx.l.google.com[74.125.159.27]:25: Operation timed out

你看到它仍然试图通过25号港口如何在mac中更改?

you see it is still trying to connect via port 25? how do i change it in mac?

推荐答案

更改 smtp_port 仅影响如何 mail()与由 SMTP 设置指定的服务器进行交互。这不是问题。问题是:

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. 您正在使用本地计算机作为SMTP服务器 - AND

  2. 您的ISP正在阻止您的本地SMTP服务器(后缀)将消息转发到Gmail

首先,读取此主题。它讨论了同样的确切问题。结果是您需要使用不同的邮件服务器,最好是您的ISPs邮件服务器。如果您想使用他们的电子邮件服务,您的ISP会告诉您用于出站邮件的服务器和端口?您应该能够从本地运行的PHP中使用,就像像Thundebird一样的电子邮件客户端,您将发送到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.

这篇关于将smtp端口从25改为587?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆