Problem with mail() function locally
Posted by: jacfev (---.225.subs.proxad.net)
Date: June 21, 2024 09:03AM

hello,

The mail() function no longer works locally. However, I have modified SMTP and sendmail_from in php.ini.
I am using wampserver3.3.5_x64.exe version on Windows 10.

Can you help me please

jacfev@free.fr

Options: ReplyQuote
Re: Problem with mail() function locally
Posted by: Otomatic (Moderator)
Date: June 21, 2024 10:40AM

Hi,

See PHP documentation: Function mail

To manage mail, it's best to use a class like PHPmailer.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Problem with mail() function locally
Posted by: jacfev (---.225.subs.proxad.net)
Date: June 21, 2024 04:32PM

Hello,

Thank you for your interest in my topic.

This mail() function worked correctly with previous versions of Wampserver.
And I just repeated the test using the example of Gaston Phone* from OVH without success.

*[wordetweb.com]

Options: ReplyQuote
Re: Problem with mail() function locally
Posted by: Otomatic (Moderator)
Date: June 21, 2024 07:58PM

Hi,

> This mail() function worked correctly with previous versions of Wampserver.
The mail() function depends solely on PHP and Wampserver itself has nothing to do with it.

Didn't you change your PHP version between "it worked" and "it doesn't work"?

By the way, what exactly "doesn't work"?

What is the return value of the mail() function?

And why are you posting in the English-speaking forum when you're obviously in France?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Problem with mail() function locally
Posted by: jacfev (---.225.subs.proxad.net)
Date: June 21, 2024 11:30PM

I've found. Wampserver does not read smtp or sendmail_from in php.ini. You must set the corresponding values ​​with the ini_set() function.

Options: ReplyQuote
Re: Problem with mail() function locally
Posted by: Otomatic (Moderator)
Date: June 22, 2024 08:38AM

> Wampserver does not read smtp or sendmail_from in php.ini.
If you're using PHP as an Apache module, you'll need to modify the PhpForApache.ini file.

If you're using PHP in FCGI mode, you'll need to modify the php.ini file.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Problem with mail() function locally
Posted by: jacfev (---.225.subs.proxad.net)
Date: June 22, 2024 10:49AM

I modified the SMTP and sendmail_from values ​​in the phpForApache.ini file in the php7.4.33 folder (this is the PHP version I use) and now I can send an email.

Thank you for your help.

Options: ReplyQuote


Sorry, only registered users may post in this forum.