Hello, Diego here. I hope you guys can help me with this one. If i run the code below in my hosting space:
<?php
$errno = 0;
$errstr = '';
$socket_context = stream_context_create();
$smtp_conn = stream_socket_client(
"smtp.mandrillapp.com:587",
$errno,
$errstr,
10,
STREAM_CLIENT_CONNECT,
$socket_context
);
while (is_resource($smtp_conn) && !feof($smtp_conn))
{
$str = fgets($smtp_conn, 515);
echo $str;
// If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
if ((isset($str[3]) and $str[3] == ' ')) break;
}
I get this:
220-server.dhdinc.com ESMTP Exim 4.80 #2 Wed, 06 May 2015 14:06:16 -0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
As you can see this function is ignoring remote_host parameter completely and uses server.dhdinc.com instead of smtp.mandrillapp.com. How this can be? Any ideas?
Thanks.