Question

I need a php script that you can use to set up a online newsletter and then have a link that will allow the visitors to email the Web Page as a Newsletter to someone elses email...

Is this possible? I suppose it is, as it is done here. That is exactly what I need. I want to set up a newsletter, add a script that will allow the visitor to send that newsletter directly to a friends inbox. http://www.pretoria.co.za/interactive/forward-newsletter.html

I suppose I just need the script to send an html file to the email address

Please help - thank you

Was it helpful?

Solution

That can be written fairly easily using one of the email wrapper scripts, such as phpMailer. However, when doing so, pay particular attention to issues that could lead to spam and other abuse of the form. You should spend the time to really lock down the client-side, as well as server-side validation on all input variables.

That being said, the best way is to save the HTML of the page in a database, and pull it out into the body of the email. You should also include a text-only version as an alternate body so people without HTML email will be able to read it. Then, when someone submits the form, just validate the data, put together the message with the methods available with the mailer class you choose, send the email, and then redirect to a "thank you" page.

OTHER TIPS

Use a MySQL and mail function, or use e.g. this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top