Connecting Tech Pros Worldwide Help | Site Map

Mail function not working properly

Member
 
Join Date: Nov 2008
Location: Chennai, India
Posts: 100
#1: 4 Weeks Ago
Hi,

I am using mail function in my php page, As soon i update the details, i have to send mail to the customer with the updated details,

problem is when i send mail it simple through waring msg as:

Quote:
Waring mail() [function mail]: SMPT sever response: 550 Relaying not allowed in d:/wamp/update.php
can anyone help me why such problem occurs, how to over come this problem.

Thanks in advance,

Regards,
magesh
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: 4 Weeks Ago

re: Mail function not working properly


what’s the code you use?
Member
 
Join Date: Nov 2008
Location: Chennai, India
Posts: 100
#3: 4 Weeks Ago

re: Mail function not working properly


Expand|Select|Wrap|Line Numbers
  1.  
  2. $to  = get_mail($phnumber);  // retrive mail id based on there ph number    
  3. $subject = 'order details';
  4.  
  5. $message .= 'Order Details'; // html body
  6.  
  7. // To send HTML mail, the Content-type header must be set
  8. $headers  = 'MIME-Version: 1.0' . "\r\n";
  9. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  10.  
  11. // Additional headers
  12. $headers .= 'To: '. $to . "\r\n";
  13. $headers .= 'From: <order@example.com>' . "\r\n";
  14.  
  15. // Send Mail
  16. mail($to, $subject, $message, $headers);    
  17.  
  18.  
This is the simple code i used here, but no use of it, mail goes once for 5 times, other mail returns with above said Warning

please help how to over come this,

Thanks in advance

Regards,
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: 4 Weeks Ago

re: Mail function not working properly


how does $to look like?
Member
 
Join Date: Nov 2008
Location: Chennai, India
Posts: 100
#5: 4 Weeks Ago

re: Mail function not working properly


Quote:

Originally Posted by Dormilich View Post

how does $to look like?

k then make it as

$to = 'magesh.apr@example.com';

the final $to value will be this only.

Thanks,

Regards
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#6: 4 Weeks Ago

re: Mail function not working properly


probably the Windows sentmail chokes on <order@example.com>. try it without < >, although the error implies that example.com is not your current host name…
Reply