Webmastersite.net
Register Log In

Mail function
Smtp Server Alteration

Comments on Mail function

shahramsh
Beginner

Usergroup: Member
Joined: Mar 01, 2005
Location: budapest

Total Topics: 2
Total Comments: 3
1 of 1 people found this comment helpful
Posted Mar 01, 2005 - 8:40 PM:

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");

?>
------------------------------------------------------------
shahramsh
Beginner

Usergroup: Member
Joined: Mar 01, 2005
Location: budapest

Total Topics: 2
Total Comments: 3
Posted Mar 21, 2005 - 6:27 PM:

What is this forum for, if there is no reply at all?

not even saying "we don't know" or "we don't have time for that" etc.......

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 22, 2005 - 1:22 PM:

This forum is very clearly labeled as a self-help forum. You get what you pay for, and you haven't paid anything. Also code alterations would violate the terms of service of the basic edition. Anyhow, there is no supported SMTP method though what you posted should be integratable into the sendemail function.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.