Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2004
    Location
    Leamington, UK
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mail() sending issue

    Hi guys

    im having a problem using mail() .. again lol

    heres my code
    PHP Code:
    $email $_POST['email'];
    $username $_POST['username'];
     
    $message 'Registration Successful, You can Now Login<br>';
     
    $message .= "Your password has been sent to $email";
    $ToEmail $email;
    $ToName $username;
    $ToSubject "MYSITE Registration";
    $headers "MIME-Version: 1.0\r\n"
    $headers "Content-type: text/html; charset=iso-8859-1\r\n";
    $EmailBody " Thank you for joining our community !";
    $EmailBody .= "<br>";
    $EmailBody .= "Your password is <b>REMOVED</b>";
    $EmailBody .= "<br>";
    $EmailBody .= "To change your password login and go to Edit Profile -> Change Password";
    $fromname "MYNAME";
    $from "USER@MYDOMAIN.CO.UK";
    mail($ToName." <".$ToEmail.">",$ToSubject,$EmailBody,"From:".$fromname."<".$from.">"); 
    is that the correct format ?
    Last edited by MatesOnline; 09-29-2004 at 05:43 AM.

  • #2
    New Coder
    Join Date
    Jul 2004
    Location
    Leamington, UK
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi guys.. solved it .... well almost !
    PHP Code:
    $ToSubject "mysite Registration";
    $from "me@mysite.co.uk";
    $headers "MIME-Version: 1.0\r\n"
    $headers .= "From: ME <$from>\r\n"
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $EmailBody " Thank you for joining our community !";
    $EmailBody .= "<br>";
    $EmailBody .= "Your password is <b>removed</b>";
    $EmailBody .= "<br>";
    $EmailBody .= "To change your password login and go to Edit Profile -> Change Password";
    $fromname "Me";
    mail($username." <".$emailaddress.">",$ToSubject,$EmailBody); 
    it sends a message although it is showing Nobody as teh sender . its not displaying my name

    any ideas guys ?

  • #3
    New Coder
    Join Date
    Jul 2004
    Location
    Leamington, UK
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    solved

    PHP Code:
    $ToSubject "MySite Registration";
    $from "me@mysite";
    $fromname "My Name";
    $headers  "MIME-Version: 1.0\r\n"
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"
    $headers .= "From: ME <me@mysite.co.uk>"
    $EmailBody " Thank you for joining our community !";
    $EmailBody .= "<br>";
    $EmailBody .= "Your password is <b>removed</b>";
    $EmailBody .= "<br>";
    $EmailBody .= "To change your password login and go to Edit Profile -> Change Password";
    mail($emailaddress,$ToSubject,$EmailBody,$headers); 
    as you may notice i changed the mail($emailaddress,$ToSubject,$EmailBody,$headers); bit.

    also i forgot to add $headers lol Doh!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •