简体   繁体   English

从XAMPP / Sendmail上的gmail帐户发送电子邮件

[英]sending email from gmail account on XAMPP/Sendmail

I know this has been done to death on here, but most questions are old, and the responses aren't working this end, so I'm afraid it's a slight repeat. 我知道这已经做完了,但是大多数问题都是老问题了,为此目的,回应并没有奏效,所以我担心这只是一个重复。

All I'm trying to do is use XAMPP to send external email via a mail() function in php. 我要做的就是使用XAMPP通过php中的mail()函数发送外部电子邮件。 When set up on a remote server this is all fine. 在远程服务器上设置时,就可以了。 Change to a local XAMPP server, and nadda. 更改为本地XAMPP服务器和nadda。

I've tried several tutorials etc and nothing has worked. 我尝试了一些教程等,但没有任何效果。 My current php.ini, sendmail.ini and my sendmail debug.log are below. 我当前的php.ini,sendmail.ini和我的sendmail debug.log在下面。 Is there something obvious I'm missing? 有什么明显的我想念的东西吗?

Port numbers seem to conflict in other answers, with 25, 465 and 587 listed. 端口号似乎与其他答案冲突,列出了25、465和587。 Could this be it? 可以吗?

Thanks in advance 提前致谢

13/12/03 10:02:24 ** --- MESSAGE BEGIN ---
13/12/03 10:02:24 ** To: *********@gmail.com
13/12/03 10:02:24 ** Subject: Information Request
13/12/03 10:02:24 ** enter your email address
13/12/03 10:02:24 ** 
13/12/03 10:02:24 ** message here
13/12/03 10:02:24 ** --- MESSAGE END ---
13/12/03 10:02:26 ** Connecting to smtp.gmail.com:587
13/12/03 10:02:26 ** Connected.
13/12/03 10:02:26 << 220 mx.google.com ESMTP o9sm3899245wib.10 - gsmtp<EOL>
13/12/03 10:02:26 >> EHLO Desktop<EOL>
13/12/03 10:02:26 << 250-mx.google.com at your service, [82.22.12.96]<EOL>250-SIZE 35882577<EOL>250-8BITMIME<EOL>250-STARTTLS<EOL>250-ENHANCEDSTATUSCODES<EOL>250 CHUNKING<EOL>
13/12/03 10:02:26 ** Authenticating as adelejarcher@gmail.com
13/12/03 10:02:26 >> STARTTLS<EOL>
13/12/03 10:02:26 << 220 2.0.0 Ready to start TLS<EOL>
13/12/03 10:02:26 >> QUIT<EOL>
13/12/03 10:02:26 <<  5  1R¬2˜ƒdkU Kê²/Úbš‚!p·Ê1”U‹“â^      ÿ   #     z0‚v0‚^ :ä^nìó0
    *†H†÷
 0I10   UUS10U

Google Inc1%0#UGoogle Internet Authority G20
130910075447Z
140910075447Z0h10   UUS10U
California10U
Mountain View10U

Google Inc10Usmtp.gmail.com0‚"0
    *†H†÷
 ‚ 0‚
‚ ©0 ÚÖÖ×Ì®TË¥Ÿ.Jå‚ð·›’
QSÙ^ú{pî¯69~0!ã…°vFH;ARDñãRWAé«{λ?‘CjÏ)öž3s’~´«WšUm› VäVË—e;¾õðÄ7òù’–c¤bœZßæ’%•Ò¨Ýf'v?P>_ˆ,¨ÌihB?’Ÿs2Ç6>á?ßYCI¨|   ±^2òš¿D…Ÿ$X3~˜ð$Øqõÿ®¢VñöÓ [§º«ÇTÕN–æî¾ÞÖmbc0¿™¢²‘öŸ•Ó½'3xÙ‘<Vpú¥õã%ãÂÿy})´†d¶Ô‚µéâ™ÁJ0½[ £‚A0‚=0U%0++0U0‚smtp.gmail.com0h+\0Z0++0†http://pki.google.com/GIAG2.crt0++0†http://clients1.google.com/ocsp0UCMe¸ˆÌ×vø:†)Æð&º0Uÿ0 0U#0€Jݼöhµvõ¶»bºZ/0U 00
+Öy00U)0'0% # !†http://pki.google.com/GIAG2.crl0
    *†H†÷
 ‚  Þ}@µ†¼-
FÅìY§y¼_x¤_ƒYƒDZš§®×a”àbÑyC¤neï}F–<“y"LÞ¢ûsͨ‰S3åK “ÿ)HÚD¨ÿB¦ßŠÀçðüà–¿Õ$<qàqTÐYN`íR±n…ùÿЙ9™'ýå`²;Ög®ºÞÎìopYWV˜låt²ë’äÎ$׊D~1Œ"¡¿p0?Joª ó«G计˜Q9»X.+(¶ÇÓË<ƒ.¹Ëñ"h–(J«>¯m®Ë¶Æh(,WýàÝ`T•îi•å
pN­mé!óc×ÃaÂeüÐza+î‹!Tåö 0‚0‚ì :i0
    *†H†÷
 0B10   UUS10U

GeoTrust Inc.10UGeoTrust Global CA0
130405151555Z
150404151555Z0I10   UUS10U

Google Inc1%0#UGoogle Internet Authority G2
13/12/03 10:02:26 << 0‚"0<CR>   *†H†÷<CR> ‚ 0‚
‚ œ*w\ØP‘:£‚àØPH¼‰?ñpˆF~àÅñ‰Î!îZþa
·2D‰ tSOU¤Î‚b•îëY_Æá€Ä^”?¼[H8ôS÷$æû‘éÄÏôS
ôJüŸTÞ}¾ ko‡ÀÐP(0@ÚsQlÿ:<§7Ž½Kë}$Þæùü1qû”Õ`ó.J¯BÒËêÄj²ÌSÝK‹Èaͨ>c+„5ie„ÈÅF"øS•¾ã€JÆ*캗 Ç9™ ðaz•%ŒNRuâ¶íÊüÎ"j³NÏF——~À±Þ{¯E3Ϻ>q·Þô%%Â
5‰ûy‰7ůŽri £û0ø0U#0€Àz˜h‰û«d}ª}e¸ÊÌN0UJݼöhµvõ¶»bºZ/0Uÿ0ÿ 0Uÿ0:U3010/ - +†)http://crl.geotrust.com/crls/gtglobal.crl0=+10/0-+0†!http://gtglobal-ocsp.geotrust.com0U 00
+Öy0
    *†H†÷
 ‚ 6×€'­*›8w³# uX»±~ƒBºrÚØŽ6—àð•;7ýBXþ"Èk½8^Ñ;%në^gvF@ÚÈx
í•fÚŽ†o€¡ºV2•†ÜÜjÊŒ[ö¿Ìo…XÃhQÍýÈ÷y=™5ðV£½àYíOD  £ž8zöFÑO¾Ð@üUþ^<ÚV½–Q{oW*Û¢ª–ÜŒt•¾ðn•ÿð<¬²ÌsûèÆðû3³•;ãÂËhXsÛ¨$b;5
©3½x.Lx]P:Ôî Èp8ܲùgú‡@]aÀQkƒkÍ:Êá§xüÊÚ”Ð,=~yÈ P $T3q 0‚}0‚æ »æ0
    *†H†÷
 0N10   UUS10U
Equifax1-0+U$Equifax Secure Certificate Authority0
020521040000Z
180821040000Z0B10   UUS10U

GeoTrust Inc.10UGeoTrust Global CA0‚"0
    *†H†÷
 ‚ 0‚
‚ ÚÌc0ýô#V~[ß<l8äq·x‘Ô¼¡ØLø¨C¶éM!ˆÚX/f9)½x‹8è·j~q¤æÄ`¦°ï€ä‰(ž%Öíƒó­¦‘ǘÉB5­˜F’.OÊñ‡CÁ•W-Pï‰-€zW­òî_kÒ ¹ø5ÙÀF£{rÈ‘¿ÉU+ÍЗ>œ&dÌß΃qÊNæÔÕ{©ÍUÞÈìÒ^8Så\OŒ-þP#6üfæËŽ¤9 ·•9‘þ8.ÑšöM>o¯,`9âú6S9Ô^&+Û=¨½2ë(Rqå«3=á8»6„bœyê0ô_À+èqkäù £ð0í0U#0€Hæhù+Ò²•×GØ# O3˜ŸÔ0UÀz˜h‰û«d}ª}e¸ÊÌN0Uÿ0ÿ0Uÿ0:U3010/ - +†)http://crl.geotrust.com/crls/secureca.crl0NU G0E0CU  0;09+-https://www.geotrust.com/resources/repository0
    *†H†÷
  vánNK†0²ÏðÇÇq~fîÂíÔ;ÿððÈNÖC8°¹0}ÐUƒ¢jË6œèHf£m¸ÔGþ‹Z\sü®Ù28«—4ª–Òë£I¶»å‘ïƒ6ëVoÊÚ¼scä{>"Ë=í_8tœãPN¡¯˜îaò„?    
13/12/03 10:02:26 <<  F
13/12/03 10:02:26 ** Disconnected.
13/12/03 10:02:26 ** Disconnecting from smtp.gmail.com:587
13/12/03 10:02:26 ** Disconnected.
13/12/03 10:02:26 ** Disconnected.
13/12/03 10:02:26 ** Connection Closed Gracefully.

php.ini here php.ini在这里

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = *********@gmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
mail.log = "C:\xampp\apache\logs\php_mail.log"

sendmail.ini here: sendmail.ini在这里:

[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=*******@gmail.com
auth_password=********
force_sender=********@gmail.com
Gmail SMTP server address: smtp.gmail.com
Gmail SMTP user name: Your full Gmail address (e.g. example@gmail.com)
Gmail SMTP password: Your Gmail password
Gmail SMTP port: 465
Gmail SMTP TLS/SSL required: yes

Check with above information. 检查以上信息。

on your php.ini file,change the smtp from smtp.gmail.com to localhost 在您的php.ini文件上,将smtp从smtp.gmail.com更改为localhost

[mail function]
SMTP = localhost
;http://php.net/smtp-port
smtp_port = 25

I think that should solve it 我认为应该解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM