Posts

Showing posts with the label SMTP

How to Send Mail using SMTP and PHP?

how to use  SMTP send mail script This article is all about " send Mail using SMTP and PHP ". so now you  can send your email SMTP authentication smtp and php script. each mail needed server authentication, So you have to buy mail server. First you have to make a php file and add this code in this file and file name should be  SMTPClass.php <?php class SMTPClient { function SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body) { $this->SmtpServer = $SmtpServer; $this->SmtpUser = base64_encode ($SmtpUser); $this->SmtpPass = base64_encode ($SmtpPass); $this->from = $from; $this->to = $to; $this->subject = $subject; $this->body = $body; $this->newLine = "\r\n"; if ($SmtpPort == "") { $this->PortSMTP = 25; } else { $this->PortSMTP = $SmtpPort; } } function SendMail (){ if ($SMTPIN = fsockopen ($this->SmtpServer, $this->PortSMTP)) { fputs ($SMTPIN, &qu