Sending html email using Telnet, SMTP and Etisalat

We are a web designing company and we came to know that when we are sending some mail using the php mail function, the mail does not go to the recipent on time. so we developed a unique way so that the user gets the email as soon as it is sent.

<? 

$body = “<html><body><h1>hello world</h1></html>”;
$smtp_server = fsockopen(“mail.emirates.net.ae”, 25, $errno, $errstr, 30);

  if(!$smtp_server)
  {
   // We have an error, do something
   //echo “$errstr”;
   exit;

  }
  

 fwrite($smtp_server, “HELO its_me\r\n”);
  echo fgets($smtp_server);

  fwrite($smtp_server, “MAIL FROM:<sample@sample.ae>\r\n“);
  echo fgets($smtp_server);
  fwrite($smtp_server, “RCPT TO:<sample@sample.com>\r\n“);
  echo fgets($smtp_server);
  fwrite($smtp_server, “DATA\r\n”);
  fwrite($smtp_server, “Subject: Feedback from $name!\r\n”);
  fwrite($smtp_server, “Mime-Version: 1.0;\r\n”);
  fwrite($smtp_server, “Content-Type: text/html; charset=ISO-8859-1;\r\n”);
  fwrite($smtp_server, “$body\r\n”);
  fwrite($smtp_server, “.\r\n”);
  fwrite($smtp_server, “.\r\n”);
  fwrite($smtp_server, “.\r\nQUIT\r\n”);

?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s