• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Website emailing problem

xoggoth

More fingers than teeth
Joined
Jul 8, 2005
Messages
17,131
Likes received
4,950
Thanks received
1,184
Location
xoggoth towers
Been sorting a problem with manual spam sent from my website contact page and found another.

If I enter my @gmail.com address in the email field the mail is sent but if I enter my @btinternet.com address it isn't. Can't see why that should be. The PHP code is:

$title = "Web Site Enquiry";
$headers = "From: $email\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "MIME-Version: 1.0\r\nContent-type: text/plain; charset=iso-8859-1";
$msg = "Mail sent via xxx website\r\n".$msg;
mail($recipient,$title,$msg,$headers);

Anyone see any reason why that's ok when $email is gmail but not BT?? Cheers.

PS Nearly posted this in Light Relief. Complete senility coming soon.
 
Last edited: 10:53
Are BT blocking email from your domain as spam?
 
Cheers SM. No, should have said this in post, nowt in spam/junk either locally or in webmail.

$recipient in that code is sales@mywebsite.co.uk and the bt emails are all listed in the inbox.

That is redirected to a gmail account and they are not in the gmail inbox. However, there is also nowt in the spam box as I would expect if gmail was blocking them.
 
Last edited: 11:08
Been sorting a problem with manual spam sent from my website contact page and found another.

If I enter my @gmail.com address in the email field the mail is sent but if I enter my @btinternet.com address it isn't. Can't see why that should be. The PHP code is:

$title = "Web Site Enquiry";
$headers = "From: $email\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "MIME-Version: 1.0\r\nContent-type: text/plain; charset=iso-8859-1";
$msg = "Mail sent via xxx website\r\n".$msg;
mail($recipient,$title,$msg,$headers);

Anyone see any reason why that's ok when $email is gmail but not BT?? Cheers.

PS Nearly posted this in Light Relief. Complete senility coming soon.
Is this your own server?
I.e. you have access to the SMTP logs?

Or, are you sending to an SMTP server you don't control?
 
Cheers SM. No, should have said this in post, nowt in spam/junk either locally or in webmail.

$recipient in that code is sales@mywebsite.co.uk and the bt emails are all listed in the inbox.

That is redirected to a gmail account and they are not in the gmail inbox. However, there is also nowt in the spam box as I would expect if gmail was blocking them.

Could you temporarily switch off the redirect and see if they are making it to the BT address, but just not being forwarded (again checking junk/spam there)
 
Been sorting a problem with manual spam sent from my website contact page and found another.

If I enter my @gmail.com address in the email field the mail is sent but if I enter my @btinternet.com address it isn't. Can't see why that should be. The PHP code is:

$title = "Web Site Enquiry";
$headers = "From: $email\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "MIME-Version: 1.0\r\nContent-type: text/plain; charset=iso-8859-1";
$msg = "Mail sent via xxx website\r\n".$msg;
mail($recipient,$title,$msg,$headers);

Anyone see any reason why that's ok when $email is gmail but not BT?? Cheers.

PS Nearly posted this in Light Relief. Complete senility coming soon.

I take it $email is the email address that has been entered on the form?

If so that's really not good practice and Im surprised that it works with any address other than one that is local to the mail server.

Normally a mail server (more accurately an SMTP server) would be configured only to accept emails where the senders domain matches that of the authenticated user*.. What mail server are you sending through? I assume that from your point of view it is "localhost" if thats the case you need to find out where localhost is relaying to as thats likely to be where your problem is.

* Doing otherwise would open the server up to all sorts of abuse and would quickly get it added to one of the many blacklists - which also might be the issue, check your mail server isnt blacklisted some providers simply wont accept email from blacklisted mail servers so it wont even show as spam.
 
Last edited: 13:23
Cheers all. I meant forwarded not redirected. Ill have a go at these. With Hostpapa, not sure where I'll find logs but have a look and also change the headers to match the server.

Without any rebounds or spam it's hard to see which particular spam checker is blocking things.
 
Changed headers and seems ok now. Not sure how I made that mistake, onlne ordering emails all correct, just that little contact thing.

Also seem to have all the blocked emails on hosting webmail now. Weren't there yesterday.

Cheer again all.
 

Advertisers

Back
Top