pakenney38 Posted February 23, 2006 Share Posted February 23, 2006 In PHPMailer's syntax there is this thing:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$mail->Body = "";[/quote]Is there any way to put PHP code and double quotes inside this statement to send out a dynamic-type HTML e-mail message? I've tried escaping double-quotes and all that, but it never seems to work. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted February 23, 2006 Share Posted February 23, 2006 Not sure where your getting the $mail->Body from...unless you are using a self/3rd party created class to create and send emails...which could be your problem.the mail function allows you to include all the quotes and variables you want...just escape the quotes, and remember the difference between double and single quotes with regard to variable substitution.[code]$body = "this is a quote: \"some text\" \n\nfollowed by a var: $var";mail('you@mail.com', 'An email for you',$body);[/code][a href=\"http://us2.php.net/manual/en/function.mail.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.mail.php[/a] Quote Link to comment Share on other sites More sharing options...
pakenney38 Posted February 25, 2006 Author Share Posted February 25, 2006 I thought the PHPMailer class was fairly common. Guess I was wrong. Well, I will try to get mail setup up in my php config to use our SMTP server then. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 25, 2006 Share Posted February 25, 2006 It depends. Some people roll their own and some done ... and some don't send email that needs PHPmailer.There is a email list devoted to phpmail. You can sign up at [a href=\"http://lists.sourceforge.net/lists/listinfo/phpmailer-general\" target=\"_blank\"]http://lists.sourceforge.net/lists/listinf...pmailer-general[/a]KenIn answer to your original question.... If you manage to put PHP code into an email message, where is the server that is going to process that code? There is no way that PHP code will execute in the confines of an email message. It might be better to create a special web site and email the URL.Also, since you never showed us what you attempted, there was no way that anyone could even try to help.If you need help, post the code that is giving you problems and what you attempted.Ken Quote Link to comment Share on other sites More sharing options...
pakenney38 Posted February 27, 2006 Author Share Posted February 27, 2006 I will pull the code together and post it tomorrow from work.In a nutshell, say I have some PHP code. I want to process that PHP code into HTML first, and then send the HTML through an e-mail message. Right now I can't make that happen with PHPmailer without getting a parse error, even if I escape all of the double-quotes and stuff. I may just be missing something.By the way, as a separate argument, mailing lists are a nuisance. Basically you are force-fed all of this mail that you may not be able to help with, but you get it in your Inbox anyway. At least with a message board, you can pick and choose what you want to reply to, without having to sort or delete anything. Mailing lists are archaic. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 27, 2006 Share Posted February 27, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]By the way, as a separate argument, mailing lists are a nuisance. Basically you are force-fed all of this mail that you may not be able to help with, but you get it in your Inbox anyway. At least with a message board, you can pick and choose what you want to reply to, without having to sort or delete anything. Mailing lists are archaic.[/quote]But if there is a mailing list available to you that can help with your problem, then you use that tool.I am subscribed to many mailing lists, they all are filtered into their own mailboxes. I don't read most of the messages when then come in, but if I have a problem, I will search the saved messages for a solution. I can scan the subject lines in saved messages just as well as I can scan them in a forum. Plus I can read and search the mailboxes even when I'm offline.I think mailing lists still have their place in the online world, just USEnet newsgroups have a place. The predate many mailing lists.Ken Quote Link to comment Share on other sites More sharing options...
pakenney38 Posted February 28, 2006 Author Share Posted February 28, 2006 code soon to be posted... Quote Link to comment Share on other sites More sharing options...
pakenney38 Posted March 1, 2006 Author Share Posted March 1, 2006 nevermind. I rewrote the code to use mail() instead of PHPmailer. Since I already knew this method, it worked. The only issue I have with it is that our SMTP server requires that the outgoing email address be described very specifically, and I'm having a hard time masking this address. But that's another thread. Quote Link to comment 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.