I'm trying to send smtp
request to my smtp
server installed in freebsd
and read the successful or fail response?
This is my code :
$url = '192.168.1.227:25/';
$user = 'admin';
$pass = '123';
$params = array(
'User' => $user,
'passwor' => $pass,
'to' => 'example1@example.com',
'subject' => 'test',
'html' => 'body',
'text' => 'text',
'from' => 'example2@example.com',
);
$session = curl_init($url);
curl_setopt ($session, CURLOPT_POST, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_HEADER, 1);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
$info = curl_getinfo($session);
curl_close($session);
echo $response;
print_r($info);