Question

I have currently the following and it's not working. (normally I have a body text and header information, but nothing works)

mail("idealvisions@live.com","Nieuw offerte aanvraag","test");

We'll on my server it did because I'm running php 5 or higher, no problem there. But the contact page is from a client which runs php 4.4 I believe. Now the client is really pushing me to get this fixed but it won't seem to fix. I've tried everything

What's the problem here? is it the php version?

I checked also with phpinfo and have this

sendmail_from   no value    no value

sendmail_path   /usr/local/bin/bgc_webhosting_mailer.sh /usr/local/bin/bgc_webhosting_mailer.sh
Was it helpful?

Solution

This sounds like the Client's server is not set up properly with a mail-sending handler

OTHER TIPS

some ISP's that provide hosting and some free hosting platforms disable the mail function, can you try something like this:

error_reporting(E_ALL);
if (mail ('you@yourdomain.com', 'Test subject', 'Test Body')){
echo 'Mail sent';
}else{
echo 'Mail not sent';
}

if there is an issue with mail() on their server you could consider posting to a mail form on one of your servers and then bouncing them back to a thankyou page on the client's server after.

From the sendmail path, your host uses a custom sendmail program/shell script.

Since the sendmail from isn't set, you have to set it within the mail() function, unless it is hardcoded into /usr/local/bin/bgc_webhosting_mailer.sh in which case you should ask the hosting.

Example setting sender:

mail('recepient@example.com', 'Test subject', 'Test Body', "from:sender@example.com\n");

If the mail() function really is NOT available, then ask your hosting about an alternative, such as their local SMTP server.

You can then use the local SMTP server to send email. Probably the easiest way to do this is donwload an email library that supports sending via SMTP such as PEAR Mail or SwiftMailer for example.

Pear: http://pear.php.net/package/Mail Swift: http://swiftmailer.org/

If your host does not provide an SMTP server, you should probably look for a different host. However, you can always use a free email service such as Gmail, or Yahoo and send mail through their SMTP.

Also check SeLinux, it can prevent any thread spawned by Apache to send mail. In that case you get no error and no mail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top