monkeybidz Posted May 29, 2006 Share Posted May 29, 2006 I was wondering if it is possible to put an html form in the body of a php email.This is the current mail code:<? mail ("$email", 'Statement for '."$month".'/'."$year", "This is where i would like to put the form(PayPal Button).If you have any questions, please contact:$admin_emailThank You!",'From:'."$website_name". '<'."$admin_email".'>');?>All variables are passed from another page. I need to send a PayPal Button which is a form. Link to comment https://forums.phpfreaks.com/topic/10730-putting-html-in-php-email-body/ Share on other sites More sharing options...
poirot Posted May 29, 2006 Share Posted May 29, 2006 Yes it is. Just add a header:[code]<?php$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From:'."$website_name". '<'."$admin_email".'>' . "\r\n";mail ("$email", 'Statement for '."$month".'/'."$year", "This is where i would like to put the form(PayPal Button).If you have any questions, please contact: $admin_emailThank You!", $headers);?>[/code] Link to comment https://forums.phpfreaks.com/topic/10730-putting-html-in-php-email-body/#findComment-40074 Share on other sites More sharing options...
monkeybidz Posted May 29, 2006 Author Share Posted May 29, 2006 Worked great, but how would i put the form in?[code]<?php$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From:'."$website_name". '<'."$admin_email".'>' . "\r\n";mail ("$email", 'Statement for '."$month".'/'."$year", "This is where i would like to put the form(PayPal Button).If you have any questions, please contact: $admin_emailThank You!", $headers);?>[/code]I tried regular:<form>this is my form</form>, but does not work. Link to comment https://forums.phpfreaks.com/topic/10730-putting-html-in-php-email-body/#findComment-40082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.