🔥 با کمک هوش مصنوعی در کمتر از 6 ماه فول‌استک شوید ...
۰ ثانیه
۰ دقیقه
۰ ساعت
۱۱ آقای اسلان جمادی
ارسال نشدن ایمیل
جامعه پی اچ پی ایجاد شده در ۰۵ اردیبهشت ۱۴۰۱

سلام من این کارهایی که گفتید رو انجام دادم ولی ایمیلی ارسال نمیشه و ارور زیر رو میده:

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\\xampp\\htdocs\\PHP - Tutorial\\proccess.php

سلام دوست عزیز وقت بخیر

به نظر میرسه کانفیگ شما درست انجام نشده

لطفا کدهای خودتون رو و همچنین محتویات فایل کانفیگ رو پیوست کنید تا کامل بررسی کنیم.

نوری خداپناهی ۰۵ اردیبهشت ۱۴۰۱، ۱۲:۱۴

سلام من این کارهایی که گفتید رو انجام دادم ولی ایمیلی ارسال نمیشه و ارور زیر رو میده:

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\\xampp\\htdocs\\PHP - Tutorial\\proccess.php

آقای اسلان جمادی ۰۵ اردیبهشت ۱۴۰۱، ۱۲:۲۵

e232-image.png

آقای اسلان جمادی ۰۵ اردیبهشت ۱۴۰۱، ۱۲:۲۷

فایلی رو نمیشه ارسال کرد!

آقای اسلان جمادی ۰۵ اردیبهشت ۱۴۰۱، ۱۲:۲۷

لطفاً محتویات فایل php.ini رو قرار بدید

در اکثر مواقع ارسال نشدن ایمیل به دلیل مشکلات رایج زمپ هست که این اتفاق میوفته و به جای زمپ میتونید از نرم افزار لاراگون استفاده کنید که بیشتر خطاهای زمپ رو نخواهید داشت و خیلی راحت‌تر خواهید بود و حتی برای تغییر ورژن php یا نصب ssl هم میتونید با یک کلیک این کار رو انجام بدید.

نوری خداپناهی ۰۵ اردیبهشت ۱۴۰۱، ۲۰:۱۹
; configuration for fake sendmail
; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\\Software\\Sendmail
[sendmail]
; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory.  (generally C:\\Inetpub\\mailroot\\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.
; smtp_server=mail.mydomain.com
smtp_server=smtp.gmail.com
; smtp port (normally 25)
smtp_port=465
; SMTPS (SSL) support
;   auto = use SSL for port 465, otherwise try to use TLS
;   ssl  = alway use SSL
;   tls  = always use TLS
;   none = never try to use SSL
smtp_ssl=auto
; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify
;default_domain=mydomain.com
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
error_logfile=error.log
; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
;debug_logfile=debug.log
; if your smtp server requires authentication, modify the following two lines
auth_username=myGmail@gmail.com
auth_password=myPassword
; if your smtp server uses pop3 before smtp authentication, modify the 
; following three lines.  do not enable unless it is required.
pop3_server=
pop3_username=
pop3_password=
; force the sender to always be the following email address
; this will only affect the "MAIL FROM" command, it won't modify 
; the "From: " header of the message content
force_sender=
; force the sender to always be the following email address
; this will only affect the "RCTP TO" command, it won't modify 
; the "To: " header of the message content
force_recipient=
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required
hostname=
آقای اسلان جمادی ۰۷ اردیبهشت ۱۴۰۱، ۱۵:۲۲

سلام دوست عزیز

چرا mailserver روی localhost؟

mailserver at "localhost" 

محمد گازری ۰۸ اردیبهشت ۱۴۰۱، ۰۷:۲۰

ببخشید متوجه منظورتون نشدم!

آقای اسلان جمادی ۰۸ اردیبهشت ۱۴۰۱، ۰۹:۴۶

این ویدیو آموزش ارسال ایمیل توسط زمپ هستش و تمام کارهایی که گفتند رو انجام دادم ولی این ارور رو برای من میاره!

آقای اسلان جمادی ۰۸ اردیبهشت ۱۴۰۱، ۰۹:۴۷

با استفاده از راهنمای زیر پیش برید و مطمئن باشید اکانت جیمیلتون ورود دومرحله ای فعال نداشته باشه

https://www.milople.com/blogs/how-to-send-mail-from-localhost-xampp-using-gmail/

اگر کار نکرد راه‌های جایگزین رو بهتون معرفی میکنم

بهترین پاسخ
محمد گازری ۰۸ اردیبهشت ۱۴۰۱، ۱۶:۲۱

مرسی مشکل حل شد.

آقای اسلان جمادی ۰۸ اردیبهشت ۱۴۰۱، ۱۷:۰۹