Hey all,
Ok so I got my pear mail script to run but im geting SMTP time out issue
How can i deagnose the problem? Is there a way to do test block ex determine if SMTP found, connected to smtp, authenticated, sent message... and not jsust test for mail sent?
// Constructing the email $sender = "xxxx<xxxx@mailserver.net>"; // Your name and email address $recipient = "<xxxxx@hotmail.com>"; // The Recipients name and email address $subject = "Our New System"; // Subject for the email //$text = 'This is a text message.'; // Text version of the email $html = '<html><body><p>Hey please veryfy that our new system is working!</p></body></html>'; // HTML version of the email $crlf = "\n"; $headers = array( 'From' => $sender, 'Return-Path' => $sender, 'Subject' => $subject );
// Creating the Mime message $mime = new Mail_mime($crlf);
// Setting the body of the email //$mime->setTXTBody($text); $mime->setHTMLBody($html);
// Set body and headers ready for base mail class $body = $mime->get(); $headers = $mime->headers($headers);
Your server is failing to connect at all to mail101.net on port 587 - it's not reachable, and it timed out on your side while waiting for any response. If there was a handshake things would be different.
Things to check, in order:
Most mail hosts allow IMCP so can you ping the hostname or only by IP? Check for DNS issue - you'd be surprised how common this is.
Are you sure its not smtp.mail101.net or whatever subhost name? Sometimes they use mail101.net CNAMED for web traffic (port 80), not mail, sometimes not. Use whatever "official" FQDN they require, if unsure.
Make sure your local firewall/proxy allows port 587 traffic.
Check to see if mail101.net restricts access based on IP - give them your server WAN IP if so - might be firewall issue on their side or white hat access list.
Note - 587 can be used for SMTP but usually that's 25 (for the simple reason most firewall setups permit it and shut down 587) - this ties into my other advice, so this is an FYI, try port 25 if all else fails just to see (assuming you have no docs or help from mail101.net as to client setup)
-jim
Last edited by SrWebDeveloper; 03-12-2010 at 09:39 AM.
here is another question, how can i sent email to multiple users ?
I tried to use comma separated rescipients but that gave me an error.
Also I think that wouuld revieal the user list to other users ((
I have 200 email list that i need to send few updates.... im going crazu... probably should pay that mailing service and releve me from headach but i like to DIY
If you think the host is blocking you, give them your server IP and ask what port you should be using (confirm 587 vs. 25). It's up to you to ensure you can reach them, I already gave advice as to that (ping/local firewall). If you talked to 3 people, talk to another just ask for manager this time and complain you've been given conflicting info. My general advice still holds true.
As to multiple emails, assuming same subject and body, use commas to separate valid email addresses for to/bcc/cc as you need. PHP's mail function expects commas. Obviously post error message, relevant code and a few example emails (change domain name to foobar but keep rest intact so we can see syntax) if this doesn't work as expected, plus plenty of freeware PHP scripts to process email for ya including smtp, multiple addresses, templates for listserv and so on.
Bookmarks