Jump to content

[SOLVED] email error


contra10

Recommended Posts

i'm testing mail on local host

 

here is my coding that works

<?php
$headers = "From: me@worldnwired.com\r\n";
"To: $email";
"MIME-Version: 1.0\r\n";
"Content-Type: multipart/mixed;\r\n";
$body = "$username has added you as a friend";

mail("me@test.com","Friend Request",$body, $headers);
?>

here is the coding when i want to change the send to the user

<?php
$friende= "SELECT * FROM `users` WHERE `username` = '$usernamef'";
$friendgetemail = mysql_query($friende) or die(mysql_error());

while ($friendemail = mysql_fetch_assoc($friendgetemail))
{
$email = "{$friendemail['email']}";
}

$headers = "From: me@worldnwired.com\r\n";
"To: $email";
"MIME-Version: 1.0\r\n";
"Content-Type: multipart/mixed;\r\n";
$body = "$username has added you as a friend";

mail($email,"Friend Request",$body, $headers);
?>

 

the warning is

Warning: mail() [function.mail]: SMTP server response: 500 please set from & to first... in C:\wamp\www\friendrequest\index.php on line 71

 

line 71 being

mail($email,"Friend Request",$body, $headers);

how do i echo the person's email instead of writting it in

Link to comment
Share on other sites

im gettin an error for my mail form wich i cant get rid off...

 

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\mailing\inc\lib\htmlMimeMail.php on line 680

configured my php.ini to

[mail function]

; For Win32 only.

SMTP = localhost

smtp_port = 25

 

; For Win32 only.

;sendmail_from = jijodasgupta@gmail.com

 

even removed ; from php_smtp.dll file....

stil the same error....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.