PHP mail()win64
是否可以在64位Win10中的本地主机上使用PHPPHP mail()win64,php,email,xampp,localhost,win64,Php,Email,Xampp,Localhost,Win64,是否可以在64位Win10中的本地主机上使用PHPmail() 我使用xampp运行localhost并尝试使用此函数, 但它返回错误套接字错误#10060连接超时 我在32位Win上使用了这种配置,没有问题, 邮件发送时没有任何错误。 有什么解决办法吗 a) Open the "php.ini". For XAMPP,it is located in C:\XAMPP\php\php.ini. Find out if you are using WAMP or LAMP server. Not
mail()
我使用xampp运行localhost并尝试使用此函数,
但它返回错误套接字错误#10060连接超时
我在32位Win上使用了这种配置,没有问题, 邮件发送时没有任何错误。
有什么解决办法吗
a) Open the "php.ini". For XAMPP,it is located in C:\XAMPP\php\php.ini. Find out if you are using WAMP or LAMP server. Note : Make a backup of php.ini file
b) Search [mail function] in the php.ini file.
You can find like below.
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost
Change the localhost to the smtp server name of your ISP. No need to change the smtp_port. Leave it as 25. Change sendmail_from from postmaster@localhost to your domain email address which will be used as from address..
So for me, it will become like this.
[mail function]
; For Win32 only.
SMTP = smtp.example.com
smtp_port = 25
; For Win32 only.
sendmail_from = info@example.com
c) Restart the XAMPP or WAMP(apache server) so that changes will start working.
d) Now try to send the mail using the mail() function ,
mail("example@example.com","Success","Great, Localhost Mail works");
邮件将发送到“example@example.com“来自本地主机,主题行为“Success”,正文为“Great,localhost Mail works”以gmail帐户发送邮件 ->在sendmail(wamp文件夹内)文件夹中,在记事本中打开文件“sendmail.ini”进行编辑 更改此文件中的下一行
smtp_server=smtp.gmail.com//如果您使用gmail id,它只适用于来自我的ISP的电子邮件地址?我给你发邮件xxx@example.com它是有效的,但当我试着把它发送到xxx@gmail.com然后什么也没有发生。最初的问题是针对Win64的,而您的回答是“仅针对Win32”。这适用于Win64吗?