Mail funtion does not seem to work

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Mail funtion does not seem to work

Post by Reindero »

Been struggling with this for some time, but I cant seem to get the mail to work in Mantis 1.24 :(.

Config:
$g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL;

Using Apache as webserver. When trying to send a testmail I get an error.

"Testing Mail - PROBLEMS SENDING MAIL TO: bla@bla.com. Please check your php/mail server settings."

Do I need to make changes somewhere else? Can anyone PLZ help? Really stuck here :(
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

I've added in the php.ini file the following line:

[mail function]
sendmail_path = /bin/sendmail

and created the directory /sendmail (was not there).

When testing the mail (trough admin) it said that mail() was succesfull.

But I have the distinct fealing that sendmail should not be a dit. but a file (.php) since I did not recieve any mail. Any ideas?
crp
Posts: 17
Joined: 04 Apr 2011, 00:27

Re: Mail funtion does not seem to work

Post by crp »

Reindero wrote:I've added in the php.ini file the following line:
[mail function]
sendmail_path = /bin/sendmail
and created the directory /sendmail (was not there).
When testing the mail (trough admin) it said that mail() was succesfull.
But I have the distinct fealing that sendmail should not be a dit. but a file (.php) since I did not recieve any mail. Any ideas?
What is currently in /bin/sendmail? if the sendmail package is not there, php will not do anything with the email.
I found that MantisBT always reports that email was successful , even when nothing happens.

The MantisBT experts recommend using a php script (/mantis/htdocs/scripts/send_emails.php) in a cron job to send email.
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

Err, what does that mean? That the Sendmail_path should be "/mantis/htdocs/scripts/send_emails.php" ? How do those cron jobs work then?

Currently there is nothing in that folder btw....
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

Finally got the mail to work.....but with an external SMTP from Gmail (which I didnt really want to use).

Can anyone tell me how the SENDMAIL or MAIL option work? What do I need to do in the Mantis Config and the Apache php.ini file to get this to work??
crp
Posts: 17
Joined: 04 Apr 2011, 00:27

Re: Mail funtion does not seem to work

Post by crp »

Is sendmail installed on your system? what is the result of

Code: Select all

 which sendmail
when you enter it at a command prompt?
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

'which'is not recognized as an internal or external command, operable program or batch file.

Any other way I can check if it is installed?
atrol
Site Admin
Posts: 8273
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mail funtion does not seem to work

Post by atrol »

Reindero wrote: Any other way I can check if it is installed?

Code: Select all

type sendmail
Please use Search before posting and read the Manual
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

The system cannot find the file specified.

so I guess not :)
crp
Posts: 17
Joined: 04 Apr 2011, 00:27

Re: Mail funtion does not seem to work

Post by crp »

Are you running on Windows? which OS ?
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

Yeah, running windows. I believe 2008....(server)
crp
Posts: 17
Joined: 04 Apr 2011, 00:27

Re: Mail funtion does not seem to work

Post by crp »

Reindero wrote:Yeah, running windows. I believe 2008....(server)
Then I would use an SMTP setup. There are a few out there, not just gmail, that could do the job for you.
Or you can search for someone willing to help you setup the email server within W2008
Reindero
Posts: 26
Joined: 07 Jul 2008, 12:05

Re: Mail funtion does not seem to work

Post by Reindero »

A, thanks. But creating a gmail account for this purpose seems to be sufficient at this time :) Cheers
crewman
Posts: 1
Joined: 04 May 2011, 09:52

Re: Mail funtion does not seem to work

Post by crewman »

When testing the mail (trough admin) it said that mail() was succesfull.
But I have the distinct fealing that sendmail should not be a dit. but a file (.php) since I did not recieve any mail. Any ideas?
crp
Posts: 17
Joined: 04 Apr 2011, 00:27

Re: Mail funtion does not seem to work

Post by crp »

crewman wrote:When testing the mail (trough admin) it said that mail() was succesfull.
It always says it was successful even when no email actually was sent. It is only checking to see if the function worked not if the process called by the function worked.
crewman wrote: But I have the distinct fealing that sendmail should not be a dit. but a file (.php) since I did not recieve any mail. Any ideas?
what is a "dit" ?
Post Reply