mail () stopped working

the mail() function

Moderators: macek, egami, gesf

phplearner123
New php-forum User
New php-forum User
Posts: 1
Joined: Wed Apr 23, 2014 12:31 am

mail () stopped working

Postby phplearner123 » Wed Apr 23, 2014 12:45 am

Hi,
I'm new to PHP.

We have a simple mail script similar to below (done by a previous employee) and it had been working fine for some months. But suddenly, it has stopped working since yesterday and now it's my responsibility to fix this.

Code: Select all

$to = 'xyz@example.com';
$subject = 'Emailing: new clients';
$message = 'Welcome aboard';
$headers =  "From:abc@example.com';

mail($to,$subject,$message,$headers)


I don't know from which smtp server or mail server it is sending email,but it was working fine and sending emails. We have only microsoft exchange email account configured in the outlook program.

In php.ini, smtp is set to localhost and smtp_port = 25.

let me know if you need more details.

clarence
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Jan 03, 2011 1:30 am

Re: mail () stopped working

Postby clarence » Wed Apr 23, 2014 10:17 pm

You need to know the SMTP server, username, and the password being used.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: mail () stopped working

Postby seandisanti » Wed Apr 23, 2014 10:42 pm

Personally i use https://github.com/PHPMailer/PHPMailer when i have to send mail. it's quick and easy to configure using either local accounts or even remote (gmail etc) accounts.


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 0 guests

cron