sasi Posted August 17, 2010 Share Posted August 17, 2010 Dear All Good Day, i am new to PHP (a beautiful server side scripting language). i want to send a mail with line by line message i tried with different types like by placing the things in table and using <br /> but the thing is the tags are also visible in the message of the mail. Here is my code: $message1 = "Name :". $_REQUEST['name']."<br />"; $message1 .= "Surname :". $_REQUEST['surname']."<br />"; $message1 .= "Cellphone :". $_REQUEST['mobileno']."<br />"; $message1 .= "Telephone :". $_REQUEST['landno']."<br />"; $message1 .= "Fax :". $_REQUEST['fax']."<br />"; $message1 .= "Company :". $_REQUEST['company']."<br />"; $message1 .= "Email :". $_REQUEST['email']."<br />"; $message1 .= "Country :". $_REQUEST['country']."<br />"; $message1 .= "Enquity :". $_REQUEST['enquiry']."<br />"; $message1 .= "Date&Time :". $date."<br />"; For this code if try to print/echo it it is working fine it is displaying line by line, but using this variable ($message1) in the mail these <br /> are also visible. Can any one guide me to resolve(to remove these tags from the message part) this issue. Thanks in Advance. Link to comment https://forums.phpfreaks.com/topic/210917-how-to-provide-line-by-line-message-in-a-mail/ Share on other sites More sharing options...
Pikachu2000 Posted August 17, 2010 Share Posted August 17, 2010 You're sending the email as text, so replace the <br /> tags with \n and you should be good to go. Link to comment https://forums.phpfreaks.com/topic/210917-how-to-provide-line-by-line-message-in-a-mail/#findComment-1100140 Share on other sites More sharing options...
sasi Posted August 17, 2010 Author Share Posted August 17, 2010 Hi Thank's for your quick response i tried as you specified and it is working fine. Really thank you very much Pikachu2000. Link to comment https://forums.phpfreaks.com/topic/210917-how-to-provide-line-by-line-message-in-a-mail/#findComment-1100143 Share on other sites More sharing options...
Pikachu2000 Posted August 17, 2010 Share Posted August 17, 2010 Excellent. Glad I could help. Please remember to mark the thread solved (if it indeed is) using the button in the lower left corner. Link to comment https://forums.phpfreaks.com/topic/210917-how-to-provide-line-by-line-message-in-a-mail/#findComment-1100148 Share on other sites More sharing options...
sasi Posted August 17, 2010 Author Share Posted August 17, 2010 S done, thank you. Link to comment https://forums.phpfreaks.com/topic/210917-how-to-provide-line-by-line-message-in-a-mail/#findComment-1100152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.