Can newsletter content be generated with PHP? - php

I manage a live music venue's newsletter and the show listings/calendar on the main site are generated using PHP. Is there a way to generate content in newsletters via php?
Example, I create the newsletter.php file, upload the code to our newsletter service provider, and when someone opens the message, the latest listings are available in their email.
As of now, I'm only seeing a portion of the php code where I'd like to see the calendar...

You can generate the content of an e-mail with any scripting language, but only before sending it. Once the e-mail has been sent, it has to be in a format that e-mail clients understand (such as plain text or HTML).

It's also very easy to send email with php, with the mail function.
You could generate the email from your php template, and if it looks how you want it to, click a button and send that email to the people on your mailing list.
It sounds like you have a newsletter-delivery service in place, but this is another option.

Related

Email into spam at amazon server

I have an application and I have hosted that at amazon server. I have a form by which our customer will contact to admin. As customer will fill this form and submit then email will be send to admin but all emails marked as spam if I will use a self designed template. If I will use simple text what ever typed by user then its working fine and coming in to inbox. My template have simple logo and HTML/CSS code.Is there any way to solve this?
Try this:
you can use smtp mail system.
and image of your template have to encoded as inline image.
if you use phpmailer class then use this MsgHTML($html_msg); function and your image source must be same server (that means where in mail script).
then this function automatically convert into inline image
And fillup more requirement:
*from address must be real (from addr not reply_to) reply_to may be fake.
*Subject have something
More Info

Dynamic html mail process through single list with exact target fuel sdk

I want to send mails through single list every week. html mail and text mail both.
It is possible to create one list like "12548" and add the different user like "abc#gmail.com","xys#yahoo.com", and more.
Sent the one html newsletter for one user. means different user for different html newsletter.
Also sent me process with fuel sdk (php).
I have one list like "Newsletter(12548)" which has 5000 users.How i send the newsletter to every user.So i want to send the newsletter to every user with different html newsletter.
Every user is having separate newsletter.I am using this concept but i want to have one list and send different/customised newsletter to every user.
How can i achieve this?
ExactTarget has a server-side scripting language called AMPScript that allows you to send emails with dynamic content to a list of subscribers. So, you don't want to actually be sending 5000 different pre-created emails to 5000 different people for what should be a single send; you can create one email in ExactTarget that uses AMPScript to personalize the email for each subscriber on a list (this is described briefly at the bottom of the link you provided).
The email script runs separately for each subscriber on the list, so individual subscriber attributes are available in the scripting context for customizing the sent email content. If you are managing everything through the API with PHP, the HTML and AMPScript will need to be defined in a string for the body of the Email object being used in the send. The Email object should have separate properties for defining the HTMLBody versus the TextBody, and there is actually a default preference attribute on the subscriber that defines whether the HTML or text version should be used.
AMPScript documentation:
http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/

email hyperlink allow user to choose email client

On some websites when I click the contact email link, I get either a list or some icons for common email programs like gmail, yahoo, hotmail, etc., and I can pick which email program I want to open, then the email program opens and fills in the To: and Subject: fields. I can't find any web pages to show as an example, but I have seen it sometimes with Craigslist. Does anybody know how to code for this?
You can populate subject and body - in most e-mail clients - like this:
E-mail
This is usually a far better solution than making the user pick their provider and relying on an undocumented and subject-to-change URL format of some sort, not to mention it works with desktop clients like Outlook.
viewing source on craigslist you can see the urls; this is gmails:
https://mail.google.com/mail/?view=cm&fs=1&to=TOADDRESS&su=SUBJECT&body=BODY&tf=1&shva=1
you want to check each sites documentation for the particulars

Forward This E-Mail PHP Script?

Does anyone know where and or how I can build a PHP Script for a Newsletter that would allow the end-user to Forward their received E-Mail to a friend or so?
Basically, allowing them to take the entire body and subject of the e-mail and open up a new E-Mail Draft which would allow them to enter in the contacts they want to forward the e-mail to?
I am fully aware that this function is available in most, if not all, e-mail clients to this day. But it is requested that this functionality be added within the newsletter.
Any guidance? Any concepts? Any feedback would be greatly appreciated.
Thank you!
If I understand you correctly, you'd need to do the following:
in your email create a "Forward to friend" link that directs the user to a php page on a remote server.
On the remote page, create a script that would contain a form asking for the email address of the friends to email.
Use the mail() function (Or 3rd party class) to mail the users
EDIT:
You can take it another step further by using one of Google's API's to automatically grab email addresses from the users account (Like LinkedIn etc.)
Have a look at ZF's Mail class, which allows to fetch emails using POP3 or IMAP and finally decompose emails into parts.
The ZF documentation page provides extensive sample code.
Add link to email which directs user to a web page that contains
<form action="sendmails.php">
<input name="sendto" type="text"/>
...
and send more letters from there..

How can I create an email newsletter by taking objects from a database?

Well, I'm trying to create a newsletter, that will send emails to users in a database. The newsletter itself would draw "events" and other activities from a database. Whats the best way to take that list, and put them in an email? I was thinking about putting them into an html page, then sending an html email, but not all emails support html(like school email). What would your guys recommend? Could you point me to some good resources?
Also, this is for a school project, so I cant use any open source type stuff, unfortunately :(
You are correct in your assumption that if you are creating html newsletters, you will also have to do a text based version for clients that don't support html or ones that ask to have e-mail be sent only in text. You will need to make sure your code sends both versions to recipients. You could also ask the recipients for their preference and send them the specific version that they requested.
For html e-mail it is highly recommended to read the following two articles by CampaignMonitor (they specialize in e-mail marketing sofware):
HTML E-mail Design Guidelines
Guide to CSS support in email
clients
Note that I am assuming you are asking for help with the actual construction of the html for the email not the code needed to create and send the newsletter.
Good luck with your project.
==== UPDATE ====
So it seems that you actually need help in developing this project. Since this is a homework, I will provide some general advice that should steer you in the correct direction and get you started on the project. Then, if you have any specific problems with your code, you can ask about them on Stackoverflow.
There is really two things that need to be done here:
In PHP, dynamically contruct a variable that contains the html or text versions of the e-mail that needs to be sent.
Loop through your contact list and e-mail the contents of that variable.
Sending E-mail
I will start with the sending e-mail portion, because the links provide bellow also show you how to construct the message. Also, in your comment you said you already know how to contruct an html from a database. The following links show you two ways to send e-mail. You can either use the Mail function that comes with PHP or download the PEAR_Mail package. If you are allowed to use additional libraries and want to send html e-mail, I would recommend using the PEAR_Mail, because it makes things much easier if you want to send a both an html and text version of an e-mail together.
Note: To send an e-mail you will need to use some sort of mail server. If you are using Windows, you can install the SMTP service that comes with IIS or you can use an external smtp service such as google to send your e-mails.
http://www.w3schools.com/php/php_ref_mail.asp
http://us2.php.net/manual/en/function.mail.php
http://www.webcheatsheet.com/php/send_email_text_html_attachment.php
http://pear.php.net/manual/en/package.mail.mail.php
http://pear.php.net/package/Mail_Mime/docs
Construct E-mail
The complexity here will depend on whether you just want a plain text e-mail or html. For either case you will need to read the event data from your database and add it to the message that you want to send.
Some Seudocode:
Loop through datarows
message = DataRow[EventDate] + " " + DataRow[EventName] + "\n"
Loop through recipients
mail message
Hopefully this gives you a start. I would recommend getting php to send out an e-mail of a static html or text first. Once you have that code working you can start working on adding the functionality of reading event info from a database and sending it out.
Hope this helps.

Categories