Webmastersite.net
Register Log In

Mail function

Title Mail function
Description Smtp Server Alteration
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"); ?> ------------------------------------------------------------
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership shahramsh
Views 388 views. Averaging 0 views per day.
Similar Topics
Submission Date Mar 01, 2005 - 8:40 PM