PHP Email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jenijaya
    New Member
    • Nov 2006
    • 1

    PHP Email

    I tried to send an email through php
    this is the code..

    if((empty($pass wd))||(empty($u name))){
    $pwdmsg="Invali d Username or Email Id";
    }
    else{

    $header='MIME-VERSION 1.0'.'\r\n';
    $header.='Conte nt-type: text/html; charset=iso-8859-1'.'\r\n';
    $header.='From: admin@tophospit alsindia.com'.' \r\n';
    $subj="Password Request";
    $To=$_POST['txtemailid'];
    $ms="<table><tr ><td>User Name</td><td>".$uname ."</td></tr><tr><td>Pass word</td><td>".$passw d."</td></tr></table>";
    mail($To,$subj, $ms,$header);
    $pwdmsg="Passwo rd will be sent to your mail!";




    it is displaying one error msg "SMTP server error"
  • khalidbaloch
    New Member
    • Oct 2006
    • 61

    #2
    the code seem to be ok ,perhaps you dont have an smtp server installed on your system . first you need a smtp server to send an email by php .if you already have smtp server installed on your system then check your php configuration in php.ini and set your email address and smtp server hostname and port number....

    to get an smtp server use the following links :



    Download popular programs from Mail Clients for PC. Read users' reviews and get free safe software updates.

    Comment

    Working...