<?php
$smtp_server = "mail.webhostasp.com";
$port = 25;
$mydomain = "domain.com";
$username = "info@domain.com";
$password = "password";
$sender = "info@domain.com";
$recipient = "no-one@domain.com";
$subject = "Test";
$content = "Bla bla bla";
// SMTP connection
$handle = fsockopen($smtp_server, $port);
fputs($handle, "EHLO " . $mydomain . "\r\n");
// SMTP authorization
fputs($handle, "AUTH LOGIN\r\n");
fputs($handle, base64_encode($username)."\r\n");
fputs($handle, base64_encode($password)."\r\n");
// Send out the e-mail
fputs($handle, "MAIL FROM:<" . $sender . ">\r\n");
fputs($handle, "RCPT TO:<" . $recipient . ">\r\n");
fputs($handle, "DATA\r\n");
fputs($handle, "To: " . $recipient . "\n");
fputs($handle, "Subject: " . $subject . "\n\n");
fputs($handle, $content . "\r\n");
fputs($handle, ".\r\n");
// Close connection to SMTP server
fputs($handle, "QUIT\r\n");
?>
this code works only once, then dos NOT work anymore on my server.
anyone has idea??