kosaks Posted January 11, 2012 Share Posted January 11, 2012 Hello Im making html mail for my project. However the mail() function of PHP does not send my email. <?php $message = ' <html> <head> <title>Test Email</title> </head> <body> <h4>This is a test email message from me</h4> <br/> <p><b>Lorem Ipsum<b><br/> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> </body> </html> '; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To: me <[email protected]>' . "\r\n"; $headers .= 'From: Sample <[email protected]>' . "\r\n"; $headers .= 'Cc: Sample2 <sample2@mail>' . "\r\n"; $headers .= 'Bcc: sample3@mail' . "\r\n"; if(mail('[email protected]', 'Test Html Email', $message, $headers)){ echo "mail delivered"; }else{echo "mail is not delivered";} ?> Can some tell me why? Quote Link to comment https://forums.phpfreaks.com/topic/254786-mail-does-not-actually-send-an-email/ Share on other sites More sharing options...
trq Posted January 11, 2012 Share Posted January 11, 2012 Do you have error reporting enabled? What error are you getting? Have you got a mail server installed? Quote Link to comment https://forums.phpfreaks.com/topic/254786-mail-does-not-actually-send-an-email/#findComment-1306382 Share on other sites More sharing options...
kosaks Posted January 11, 2012 Author Share Posted January 11, 2012 Hello.. I don't have any error reporting installed I've been testing it on my domain.. If a use mail() function without HTML body i can actually send an email.. However when i have an HTML body it wont send an email. thanks Quote Link to comment https://forums.phpfreaks.com/topic/254786-mail-does-not-actually-send-an-email/#findComment-1306388 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.