Message Text |
Hi
My hosting server does not let me send emails through mail function
How is it possible to send emails using an external Smtp_server?
I found this on the net but i am not sure how to integrate it into the WSN links.
please let me know what if it is possible
........................................................
<?
#######################################################3
//$name : sender's name
//$html : 1 is text/html or 0 is text/plain
//$charser : your charset
function sendmail($name, $from, $to, $subject, $body, $html, $charset ) {
$smtp_server = "smtp.yourip.com"; //enter your smtp server here
$smtp_user = "yourusername"; //enter your smtp username here
if (!$smtp_sock = fsockopen("$smtp_server", 25)) {
die ("Couldn't open mail connection to $smtp_server! n");
}
fputs($smtp_sock, "HELO $smtp_servern");
fputs($smtp_sock, "VRFY $stmp_usern");
fputs($smtp_sock, "MAIL FROM:$fromn");
fputs($smtp_sock, "RCPT TO:$ton");
fputs($smtp_sock, "DATAn");
fputs($smtp_sock, "From: $name<$from>n");
fputs($smtp_sock, "X-Mailer: miplusn");
if ($html)
fputs($smtp_sock, "Content-Type: text/html;");
else
fputs($smtp_sock, "Content-Type: text/plain;");
fputs($smtp_sock, "charset=$charsern");
fputs($smtp_sock, "MIME-Version: 1.0n");
fputs($smtp_sock, "Subject: $subjectn");
fputs($smtp_sock, "To: $ton");
fputs($smtp_sock, "$body");
fputs($smtp_sock, "n.nQUITn");
fclose($smtp_sock);
}
$name = "any name";
$from = "anyname@anyeamil.com";
$to = "anyname@anyeamil.com";
$subject = "test mail";
$body = "<font color=red>this is test mail</font>";
sendmail($name, $from, $to, $subject, $body, 1, "UTF-8");
?>
------------------------------------------------------------ |