I have 2 different domains hosted by the same provider. On one of the domains, i can send an email using the PHP mail function with a from address that does not exist e.g. noreply#myrealdomainname.com.
On my other domain (which i know is hosted on a different server), the mail does not reach the recipient and an error email appears in the catchall mailbox of the domain saying that the sender address could not be verified. I can obviously fix the problem by using a valid from email address but i would like to understand where the setting is which forces the one domain to have the check done and the other one not.
Is it a setting somewhere on the server or a piece of software running on the server? I have asked my hosting company but have not had any success with an answer.
Many thanks
Bianca
Related
We have a problem using PHP mail on a shared hosting server on 1and1.com
We use SPF entries in our TXT DNS settings which include the email servers we use also confirm that outgoing emails are sent from our domain email addresses.
The scenario is: We have a button feature that allows site users to send a personal email from their email address to a client email address.
The problem is: These emails either bounce or end up in SPAM because they do not pass the SPF test.
Although I realize that we can solve the problem with a dedicated server, I was hoping someone had a solution or a way that we could solve the problem and still remain on shared hosting.
Thanks!
I am using PHP to send emails using mail.
Now I am sending it with a from address being my domain. This works fine when sending from any email address # said domain (such as abc#domain.com, fff#domain.com), but their is 1 certain address that just doesnt work.
When I send it from the email reports#domain.com (which is an email account that exists), the error logs look fine, but the email never arrives. Not in spam or anything.
Why would it be that a certain from email address is failing? I'm not sure if this is a problem with sendmail or PHP.
I've checked the settings of the reports email account and they all look the same as every other account that does work so im not sure where to start looking.
Please check your Reverse DNS, SPF and Domain Keys of your mail server and your domain
Utilize the followings #
Debouncer
MXToolBox
intoDNS
I'm using PHP mailer to as part of an enquiry form that I'm building for a client. One thing I've noticed in testing is that when I use my yahoo account as the FROM and my gmail as the to it works fine for a while but then it starts rejecting, I'm assuming because gmail is smart enough to know that the email isn't actually coming from Yahoo.
What is the best solution to this? I could use the email from the person who has actually filled in the form to show as the FROM address but I'm worried that this may eventually cause the same problem anyway? I could also send it from an email on the domain that its sending from but will that stop it from appearing as spam or black listing that email?
Any help or guidance would be great?
You are getting tagged as a spammer because you are sending the same message over and over. Set up your own mail server without a spam filter while developing if this is a problem.
You are not Yahoo -- don't pretend to be them! Set the From field to an address at the domain that's sending the mail (e.g, if your domain was example.com, send from something like inquiries#example.com or noreply#example.com).
This is probably related to SPF records. mail() will most likely try and send the mail directly to the server(s) identified by the MX record of the recipient domain, and because you are not sending from an IP address that is recognised as one of Yahoo's, Google will reject the email. If you are on *nix, you may be able to configure your system's sendmail program to relay via Yahoo. This is not an option on Windows (I don't think) because Windows has no sendmail and PHP will send the mail itself.
If you want a cross-platform solution you can use something like PEAR::Mail to relay the message through Yahoo's SMTP servers - this should resolve the problem as long as the SPF record is the source of the problem.
If your email is getting flagged as spam because of the content of the message, the only solution is to change the content of the message.
I'll try to explain the problem we have at my company the best I can :
So I have several forms across different servers. All are sent up to send emails with the mail() function in PHP to the email address email#ourcompany.fr
Now I've noticed a weird behavior : when the forms are hosted on our server (I'm talking about our apache server, the mails are handled by an exchange server) they arrive fine at the address up there.
But when the forms are hosted anywhere else on the internet, the emails arrive at the address email#ourcompany.es
What could the problem be ? SMTP configuration ? A set of rules at the exchange server ?
I am pretty much a newbie when it comes to emails and how they're handled when they're sent...
Thank you for your help.
EDIT: As per MarcB recommendation I tried the following in the shell :
XXXX:~$ nslookup -type=mx securitasdirect.es
Server: 10.40.144.166
Address: 10.40.144.166#53
securitasdirect.es mail exchanger = 10 smtp.securitasdirect.es.
XXXX:~$ host -t mx securitasdirect.fr
securitasdirect.fr has no MX record
XXXX:~$ host -t mx securitasdirect.es
securitasdirect.es mail is handled by 10 smtp.securitasdirect.es.
Alright so based on your update... and running dig from my local machine to confirm, your securitasdirect.fr domain has no MX records setup on the publicly accessible DNS servers.
Internally in your network, it's possible (likely even) you use different DNS servers which have MX records and hence internally you can deliver email to #fr while externally it's not working.
Update not sure if you're changing things as I write this answer, but it seems like I'm now getting a valid MX return for securitasdirect.fr.
Beyond that, securitasdirect.fr fails the rDNS test (see: http://www.mxtoolbox.com) while securitasdirect.es passes. It's possible this is also interfering with mail delivery.
We have three domains hosted on one dedicated server each with its own dedicated IP.
Domain A - Has the server primary IP address (default server IP)
Domain B - Has its own IP address
Domain C - has its own IP address
If an email goes out from Domain B then it uses the Domain A IP address in outgoing and this makes emails from Domain B using PHP go straight to spam box of Gmail etc.
Is there any way to change the source IP depending on where the email originates from in PHP? What should we change to fix this?
This is nothing to do with PHP.
No you can't spoof addresses in the way you suggest - but the reason that emails are being classified as spam is because you've only got Host A published in your SPF. Just add the others to the permitted senders list:
"v=spf1 a:hostA.example.com a:hostB.example.com a:hostC.example.com"
C.
You're not giving any details about your server setup so this can't really be answered. PHP can, however, use a SMTP server of your liking. The easiest way to set this up is a tool like PHPMailer.
If you can't change the IP you're sending from, you need to change domain B's MX record making Domain A (or its IP) the mail server for that domain. I'm pretty sure spam filters like Google mail look for the MX record only. Of course, you would have to have both E-Mail sending and receiving facilities on Domain A for this to work.
PHP is usually set up to drop mail onto the localhost MTA, which will always send it on from its own bound IP address. So, no.
To reduce the chances of being marked as spam because your mail comes from an address that doesn't tie up with the DNS records (MX or fallback A) for a domain, add an SPF record to the DNS for all the domains saying that mail from the sending IP address is fine.