473,395 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Some email providers don't recieve my emails

258 100+
Hi everyone
I'm having problem with sending email. Actualy When I send email to addresses on yahoo.com or hotmail.com it works fine but some other websites like gmail.com or my universities website don't recieve them..
Does anyone have any idea why?

Thanks

Heres the code

Expand|Select|Wrap|Line Numbers
  1. $headers = "To: <theaddress@example.com> \n";
  2. $headers .= "From: Mywebsite <webmaster@Mywebsite.com> \n";
  3. $headers .= "Cc: \n";
  4. $headers .= "Subject: Something \n";
  5.  
  6. $emailtext="Here's the text I send to my users";
  7.  
  8. mail("theaddress@example.com", "webmaster@Mywebsite.com"  , $emailtext, $headers);
  9.  
Oct 7 '07 #1
2 1185
bergy
89
My first inclination would be to check your headers. I know you don't need a To: header since that is taken care of by the mail() function, you are also missing some common headers that may help Google's and other mail server's SMTP server let you pass by. Below is an example of what I use for header and I've never had a problem.
[PHP]$to = "to@domain.com";
$from_name = "John Doe";
$from_email = "jdoe@domain.com";
$subject = "Subject";
$body = "Body";
$headers .= "From: $from_name <$from_email>\n";
$headers .= "X-Sender: <no-reply@yourdomain.com>\n";
$headers .= "X-Mailer: PHP\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <$from_email>\n";
mail($to, $subject, $body, $headers);[/PHP]
If those don't work, check to see if your web server (the one that is invoking the mail() function, or alternatively the SMTP server it eventually uses to send the mail) are listed on these sites (note most of the time it's by IP address):

CBL - http://cbl.abuseat.org/
SBL/XBL - http://www.spamhaus.org/

Those are the two most common sites that spam filtering software will use to blacklist IPs from known spammers. If your server's IP is listed, you can try sending them a request to have it removed, and if that doens't work contact your server administrator and ask them to resolve it by a) putting pressure on the above sites to remove it, or b) putting you on a different IP.
Oct 7 '07 #2
bnashenas1984
258 100+
Thanks for the reply
I checked the links you sent but my website wasn't on the list the problem was with my provider..

The problem is solved now
Thank you
Oct 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: krystoffff | last post by:
Hi all ! I've got a very weird problem ! I was trying to make my PHP script to send emails to every subscribed member to go faster (each email takes 1 or 2 seconds to be sent !) so I tried to...
1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
2
by: Ray Paseur | last post by:
My client is a financial services firm with very large email requirements. Hundreds of messages per day both in and out, with attachments in the 1MB to 10MB range. Can anyone suggest a US-based...
1
by: Ken Fine | last post by:
Is it possible to set up server-side mail services such that when someone e-mails to a certain address, the contents attached to that mail are processed and the processed content is returned to the...
4
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email...
21
by: briggs | last post by:
<html> <head> <script> /* AddChild */ function ac() { var c; var p = document.getElementById("p"); for (var i = 0; i < 5; i++) { c = document.createElement("DIV"); // Create 'div' element.
3
by: armando perez | last post by:
Hi, this is my first time here, but I was looking for something that may help me, and still, I haven't found something to use. I'm using a website made in .NET with C#, when I'm running my site...
4
by: shailendra deshpande | last post by:
right now i have only pain html page.and i want to send email through it using javascript plz. anybody tell me how to send email from plain html page using javascript. thanks in advance ...
6
by: sravan_reddy001 | last post by:
My webspace provided me with 100 emails.. How can i access them. How can i setup those emails..
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.