I’ve set up a “catch-all” e-mail address on one of my subdomains for testing, and I’m trying to follow the instructions at http://wiki.dreamhost.com/PHP_IMAP to manage the mailbox via PHP.
At the top of the php file is:
$mbox=imap_open($srv, "firstname.lastname@example.org", "password");
and then I’ve replicated the sample code from the wiki:
[code]$to = "email@example.com";
$subject = “Test Email”;
$body = “This is only a test.”;
$headers = “From: firstname.lastname@example.org\r\n”.
$cc = null;
$bcc = null;
$return_path = "email@example.com";
imap_mail($to, $subject, $body, $headers, $cc, $bcc, $return_path);[/code]
and added echo(imap_last_error()); below that. It gives the following error:
I suspect this is because DH instructs us to connect without TLS. But I’ve changed the ports and methods (/tls, /ssh, etc) as http://wiki.dreamhost.com/E-mail_Client_Configuration would seem to indicate (yes, I see that starttls doesn’t work- shouldn’t ssh on the correct port though?), all to no avail- any other settings renders the script unable to make the IMAP connection.
So, is there a way to establish this connection securely or else disable this block? I did check to make sure my PHP is compiled --with-imap
As additional information, I was trying to troubleshoot these issues by using mail() instead, and likewise kept getting no messages come through, and no bounces, even though the function always returned true (message accepted). In desperation I logged into the control panel of my site’s CMS and sent a test message from there, since it also uses php’s mail() function. Still no message was received, but this time I got a bounce report at my sending address saying that the outlook.com servers (where the external address I was testing sending the message to is hosted) was blocked - it said messages from 188.8.131.52 weren’t sent - please contact your ISP since part of their network is on the block list.
When I used mail() to send to a gmail address, that one went through. Still no dice on the imap_mail() function however, as expected, since it’s a connection issue, not a blacklist issue.
So, I guess part of the question is whether the blacklist issue can be resolved with Microsoft. And the other part is how can I make imap_mail() work, which is what I really want to use and the wiki indicates we should be able to.