Archive for the ‘Email tutorial and setup’ category

Send Email from a PHP Script Using SMTP Authentication

March 30th, 2011

This post about “Sending Mail using SMTP and PHP“. Now you can send emails with SMTP authentication using this script. Every mail needed server authentication, So you have to buy mail server. It’s very useful you can implement this on your web projects.

This tutorial contains three files.

- Index.php //Run Mail Form
- SMTPconfig.php // SMTP Server Cofiguration
- SMTPClass.php // SMTP Mail Sending Class

SMTPconfig.php
You have to change SMTP server details.

<?php
//Server Address

$SmtpServer=”127.0.0.1″;
$SmtpPort=”25″; //default
$SmtpUser=”username”;
$SmtpPass=”password”;
?>

 

SMTPclass.php
SMTP mail sending class.

<?php

class SMTPClient
{

function SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body)
{

$this->SmtpServer = $SmtpServer;
$this->SmtpUser = base64_encode ($SmtpUser);
$this->SmtpPass = base64_encode ($SmtpPass);
$this->from = $from;
$this->to = $to;
$this->subject = $subject;
$this->body = $body;

if ($SmtpPort == “”)
{
$this->PortSMTP = 25;
}

else

{
$this->PortSMTP = $SmtpPort;
}
}

function SendMail ()
{
if ($SMTPIN = fsockopen ($this->SmtpServer, $this->PortSMTP))
{
fputs ($SMTPIN, “EHLO “.$HTTP_HOST.”\r\n”);
$talk["hello"] = fgets ( $SMTPIN, 1024 );
fputs($SMTPIN, “auth login\r\n”);
$talk["res"]=fgets($SMTPIN,1024);
fputs($SMTPIN, $this->SmtpUser.”\r\n”);
$talk["user"]=fgets($SMTPIN,1024);
fputs($SMTPIN, $this->SmtpPass.”\r\n”);
$talk["pass"]=fgets($SMTPIN,256);
fputs ($SMTPIN, “MAIL FROM: <”.$this->from.”>\r\n”);
$talk["From"] = fgets ( $SMTPIN, 1024 );
fputs ($SMTPIN, “RCPT TO: <”.$this->to.”>\r\n”);
$talk["To"] = fgets ($SMTPIN, 1024);
fputs($SMTPIN, “DATA\r\n”);
$talk["data"]=fgets( $SMTPIN,1024 );
fputs($SMTPIN, “To: <”.$this->to.”>\r\nFrom: <”.$this->from.”>\r\nSubject:”.$this->subject.”\r\n\r\n\r\n”.$this->body.”\r\n.\r\n”);
$talk["send"]=fgets($SMTPIN,256);
//CLOSE CONNECTION AND EXIT …
fputs ($SMTPIN, “QUIT\r\n”);
fclose($SMTPIN);

//

}
return $talk;
}
}
?>

 

index.php

<?php

include(‘SMTPconfig.php’);
include(‘SMTPClass.php’);
if($_SERVER["REQUEST_METHOD"] == “POST”)
{
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['sub'];
$body = $_POST['message'];
$SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body);
$SMTPChat = $SMTPMail->SendMail();
}

?>
<form method=”post” action=”">

To:<input type=”text” name=”to” />
From :<input type=’text’ name=”from” />
Subject :<input type=’text’ name=”sub” />
Message :<textarea name=”message”></textarea>
<input type=”submit” value=” Send ” />
</form>

 

Download Source Code

 

Cleaning Mailing List.

January 20th, 2011

Often, you get a lot of returned mail after sending out your newsletters to a mailing list. To clean the list by removing all the faulty email,

1) Store all those email in a new folder in your Outlook Express.

2) Install Extract DBX, extract the dbx file to individual .eml file.
3) Install Email Bounce Handler; drag all those .eml files to the program.
4) Export faulty email address to a text file.
5) Process it at Group Mail, using Purge from group function.

6) Export only the info needed for mailing, when possible. Many contact database programs have wizards that make it easy to specify which fields to export. Skip the phone numbers, email addresses and other data that isn’t relevant for addressing.

7) Make column headings or field names clear. If you have multiple address fields, label the column you want to use as the primary address as “Mailing address.” This will help you better manage the data for future mailings and takes the guesswork out of addressing your mail pieces.

8) When you need to include Customer IDs in the mailing, instruct your mailing services provider on which fields to use to ensure accuracy.

9) If the software that generates your list can export the data in a variety of formats, check with your mail house staff on the best format to use. They can advise you on what format would be both easiest for you to manage, and a format they can use to process your list.

10) If the list will be broken into separate mailings, such as staggered mailings with weekly drops, let your mail house know how you want the delivery sequence to happen. Which states, regions or customers should get them first, second, and so on? A good mail house can work with you to sort or split the list based on your plan.

11) To help avoid delays, take a few minutes to review your list before sending it to your mail house. If it looks confusing, seems to be missing critical address data or doesn’t match your instructions, use the tips above to clean it up or call your mail house for assistance early in the process.

For more visit: www.version-next.com

10 Ways to Get More Clicks in Your Email Campaigns.

December 21st, 2010

We all want our recipients to open our email campaigns, right? But it’s what happens after the open we’re truly concerned about. We want our recipients to read our articles and take action whether it’s buying a product, service or donating to our cause. Here are ten easy actions you can take and put to work in your email marketing campaigns that might just get them clickin’.

1. More Links – Obviously you’ll link your call-to-action such as “Click Here”, but try linking your words within your article or pitch. You might find that people will respond better to more links.

2. Link Your Headlines – If you write a newsletter and you’ve got headlines for your articles, try linking the entire headline. If you sell a product link the product name.

3. Link Your Images – People are used to being taken somewhere when they click on an image. If you’ve got an image that relates to your product or cause, link it!

4. Include a Table of Contents – Let people get to the content they want to see fast by using anchor tags in your table of contents at the top of your email. There are however, issues with anchor tags not working properly for Outlook 2007 and a few other email clients so those who read their emails using these clients won’t be able to click.

5. Tease Them – Include half the story in your email and link off to the other half. Make sure in your link you tell them there is more to read. A good suggestion might be “Click to finish reading this fantastic article…” or something of that nature. Then on the page you direct them to, you can include offers that relate to your content.

6. Link Your Offer – If you’ve discounted a product make sure you link either the text or the image you use.

7. Free Gift – Give a free gift with purchase or donation, but only tell them what it is if they click on the link. Then you’ve got more real estate on the page to tell your story.

8. Give an Expiration Date – See how crazy Neiman Marcus went with their two-hour sale email. Make sure you link the date to where you want them to go.

9. Link to a Customer Video – Perhaps you’ve got a customer who made a video about your business. Why not link to it in your emails? Nothing sells you better than one of your customers plus your customer will tell all of his friends about it.

10. Personalize Your Links – If you’ve got a special offer, why not try including your recipients name in the link. “John, click here for your special discount” or “Stanley, click here to learn more about how you can save the Bay.”

The more clicks the better. Get linking!



The Value of SPF Records.

December 13th, 2010

SPF stands for Sender Policy Framework and it is the standard established in RFC 4408. Essentially, SPF validates emails sent to a mail server to determine if a message is spam. One of the biggest problems faced by ISPs trying to fight spam is the spoofing of IP addresses and domains. In such cases, blacklisting an IP address has little effect, since the spammer can use false ones. SPF is a system for validating emails before they are delivered.

SPF works by not allowing senders to forge FROM addresses. When a server establishes its mail server, it will broadcast that it only sends mail from certain systems. If a machine not on the list sends a message from the domain, the SPF-enabled server will reject it.

The benefit of SPF is that ISPs and hosting providers can set standards for mail delivery, denying message senders that do not provide valid SPF records. The unfortunate reality, however, is that the standard requires ISP adoption, and without it, SPF records are rather useless. If, for example, one ISP enforces the standard but another does not, spam can still be sent from one to the other.

It is not terribly difficult to setup SPF records on your dedicated server. Once setup, it does not require any further action on your part, and you will be contributing to create a more clutter-free Internet.

Capturing an email address.

November 4th, 2010

Capturing an email address is not a science, but getting a customer to respond to your offers is. How can we capture a ‘good’ email address, one that will respond to your offers by opening, clicking and ultimately purchasing the product or service you are selling?

This whole process starts at the point where the email address is collected. There are a few best practices that we can implement to help make sure the person signing up for your emails will know what to expect from you.

• First, give a few simple reasons why they should sign up. This reinforces the value of getting your emails.

• Show them a sampling of the different types of emails to expect. This shows the relevance of your offers you will be sending them.

• In addition to email address, ask them for more information relevant to your marketing efforts on your subscribe page – product preferences, gender, favorites, etc. Use this information to add relevance and personalization to their offers.

• Once they subscribe, immediately ask them to add your sending email address to their safe sender list. Don’t assume they know what this is or why they should do it. Explain the importance and how to go about adding you.

• Send an email to them right away to welcome them. This is a time when they will most recognize your emails as they just signed up to receive them. It’s also a good opportunity to present them with an offer. This first email will identify any bad email addresses too.

• Start the regular email schedule immediately – don’t wait a month or two – they will forget who you are or that they even signed up.

• Periodically send them a survey asking them again for information to update the preferences you’ve captured. This will keep the data on your list fresh and up-to-date.

Using these best practices will help to get ‘good’ subscribers. Next step is to make sure you keep them engaged with timely and relevant offers!

10 Benefits of Using WordPress as a CMS.

October 6th, 2010

1. Cheap or Free
Using WordPress for your website means it’s cheap or free. WordPress itself is free, a theme is easily under $100 or even free and you save loads of money (compare the cost of template vs custom design). Haven’t you heard? Stingy is in.

2. It’s That Easy
If you’ve got any computer savvy, WordPress is easy to use. If you can send an e-mail, use Microsoft Word or set up a Facebook account, then you can use WordPress. And normal use doesn’t run the risk of mucking up the design. It’s website creation for non-techies.

3. Do It Yourself
With WordPress you enter the Do-It-Yourself world. No more waiting for and paying a programmer to fix a tiny error, saving you time and money.

4. Many Users, Many Places
WordPress is online and offers multiple users, which means you’re not the only one who can fix something in a pinch and you can access it from anywhere. This means if you’ve got Internet access in Tahiti, you could work from there. That also means your important site is backed up on a secure server with multiple redundancies, not some high school kid’s laptop.

5. Climb the Search Results

WordPress also makes it easier to optimize your search engine results. That means your site is more likely to land on the first page of Google results, which means people are more likely to find you.

6. No WP Code hacking – If you like editing PHP files in your wordpress installation to create new functionality for your blog or showcase your PHP skills, then it is not possible at WordPress.com. You cannot edit the core wordpress files to suit your needs.

7. Survive Traffic Spikes – Get Slashdotted or Dugg with confidence as they balance your server load and keep your site working inspite of the huge increase in site traffic, whereas a shared hosting site should otherwise crash a server.

8. Spam is No Problem – Fighting comment spam is not an issue as preinstalled Akismet is blocking spam in the background. No need to pile on multiple Antispam plugins.

9. Freedom from WordPress Upgrades – An advantage of hosting here is that they take care of all back end upgrades, bug fixes and security issues. So when a new WordPress version is released, you need not go throught the WordPress upgrade routine everytime, it is done automatically without any FTP skills required.

10. Automatic Backups – They keep backing up your blog automatically and you need perform daily backups of your blog, just in case your server had a hardware failure.

Email Anti-virus protection?

September 28th, 2010

The email correspondence is one of the basic methods of spreading viruses. Some of the most deadly email worms and Trojan horses can be delivered to your personal or office computer as an attached file in an e-mail. The Email Anti-virus protection service enables your email provider to scan automatically all your e-mails for viruses, Trojan horses and worms and block them from being delivered if a threat is found. In this way, the Anti-Virus software installed on the server helps improve the server’s and your personal computer’s security at once.
With ClamAV, one of the most widely used and efficient mail security solutions available online, NTC Hosting guarantees that your email addresses will be protected from any kind of threat including known and unknown viruses, worms, phishing and Trojans.

Viruses are most commonly spread via email attachments. This is why you should setup your anti-virus software to automatically scan emails. Before opening an email attachment ask yourself three questions:

1. Is the email from a trusted source?
2. Does the attachment filename end with “.exe”, “.ini”, “.bat”, “.pif”. “.vbs”? These are executable files that can launch dangerous programs.
3. Does the attachment’s icon look like an executable (program) file?
If an attachment is suspicious – delete it!

Do’s and Dont’s

Do
- Use anti-virus software and always have it running.
- Update your virus software’s virus encyclopedia regularly. New viruses are being found repeatedly, therefore if your software isn’t up-to-date it won’t find and destroy them all.

Dont
- View or run email attachments unless you’re happy that they’re safe.
- Run software downloaded from obscure websites, or through file sharing applications without first checking the file for viruses. These sources are notorious for providing virus or Trojan infected files.

www.version-next.com

An electronic mailing list.

September 28th, 2010

An electronic mailing list is a special usage of email that allows for widespread distribution of information to many Internet users. It is similar to a traditional mailing list — a list of names and addresses — as might be kept by an organization for sending publications to its members or customers, but typically refers to four things — a list of email addresses, the people (“subscribers”) receiving mail at those addresses, the publications (e-mail messages) sent to those addresses, and a reflector, which is a single e-mail address that, when designated as the recipient of a message, will send a copy of that message to all of the subscribers.

How automated electronic mailing lists work
Electronic mailing lists are usually fully or partially automated through the use of special mailing list software and a reflector address that are set up on a server  capable of receiving email. Incoming messages sent to the reflector address are processed by the software, and, depending on their content, are acted upon internally (in the case of messages containing commands directed at the software itself) or are distributed to all e-mail addresses subscribed to the mailing list. Depending on the software, additional addresses may be set up for the purpose of sending commands.

Many electronic mailing list servers have a special email address in which subscribers (or those that want to be subscribers) can send commands to the server to perform such tasks as subscribing and unsubscribing, temporarily halting the sending of messages to them, or changing available preferences. The common format for sending these commands is to send an email that contains simply the command followed by the name of the electronic mailing list the command pertains to. Examples: subscribe anylist or subscribe anylist John Doe. Some list servers also allow people to subscribe, unsubscribe, change preferences, etc. via a website.

Electronic mailing list servers can be set to forward messages to subscribers of a particular mailing list either individually as they are received by the list server or in digest form in which all messages received on a particular day by the list server are combined into one email that is sent once per day to subscribers. Some mailing lists allow individual subscribers to decide how they prefer to receive messages from the list server (individual or digest).

Risks & problems in email hosting.

September 24th, 2010

For corporations with more than a hundred mailboxes, the requirement for their email facilities is clearly more demanding than that of small business users. Email archiving, privacy and escalation are important issues that they have to be deal with. It is therefore important for corporations to understand the risks and problems involved, in order to find the best way to streamline their email infrastructure. Here are some things to consider:

1) Limited email storage: Having trouble with limited email storage? For those of you who are outsourcing your email services, chances are you’ve been allocated with a limited storage facility that will be split up between a huge numbers of users.

For those of you who are hosting your own email service, the problem is probably due to limited storage space. It seems not many email service providers care enough to upgrade their storage space, although hard drives are a lot cheaper nowadays.

With limited storage, such as 200MB per mailbox, users can’t even leave a copy of their messages in the server. Instead, they have to download and delete emails frequently, even when they are on holiday, because otherwise, the mailbox will be full. Because of this, their webmail becomes useless as their Webmail’s Inbox is always empty.

2) Upkeep of mailboxes

Here’s another thing, tech people are usually reluctant to maintain the mailboxes hosted in their email servers. Why? Because they’re offered unlimited mailbox plans. This means, they don’t have to remove the mailbox of the staff who’s just left, or check if the forwarding features are correctly configured. This poses a risk to businesses.

3) Lost emails: Have you ever lost an email? It is likely that this happened because your email service provider has a poorly configured scanner that filters and drops legitimate emails into your Spam box. When this happens, who’s to blame? Their Spam tech are pretty unreliable. The real nightmare, however, occurs, when you’ve lost your email completely! Most email servers are setup on a small scale. This means, you have all your email services (POP, SMTP, Webmail, etc) installed in a single physical server. What would you do if you lost your email? Is there an archiving solution that keeps a copy of all your incoming and outgoing emails in a safe place?

4) Why isn’t my email working?
A lot of shared hosting customers use their accounts for email and that’s about it. Because of this, a lot of questions are about email. Common reasons for email not working are:

  • The entire account and/or email account are exceeding their respective disk quotas
  • The password is incorrect
  • The account is configured incorrectly
  • There is a server level issue.

To fix these issues, check out your account and the configuration of your account in your email client first. See if email can be sent from webmail. If it can, then the problem is likely with the configuration of your desktop client. Try setting it up again, and if it still doesn’t work, ask your host to check into the account further.

5) Email privacy: Did you know that ANY email hosting provider can access your email account? They also have 101 ways to keep a tab on your email activity without you being aware of it! Just like a car manufacturer will have their 101 ways to start your car without a key, the same goes with email service providers. So pick a reliable one, one that you can trust, and make sure that it has the facility and trained personnel to make sure your data is safe. Make sure they can handle your email’s privacy carefully too!

Brand your business with E-mail hosting

May 11th, 2010

E-mail hosting is an email service which allows businesses to use their domain name to create branded email accounts like sales@yourbusiness.com or you@yourbusiness.com.  Email Hosting companies run only email services on their servers. The fact that there are no other services hogging the same resources so improves reliability.

How Does Email Hosting Work?

To send or receive emails, you  need an email server (also called “mail server”). The term Email Server refers to two different aspects of email hosting, the email server can refer to the hardware server on which emails are handled in a dedicated email server scenario. This server also refers to the software used on the server to handle emails, whether a dedicated email server is used or emails are handled by a server performing another function like web server.

The email server is responsible for receiving, relaying or distributing emails. Each mail server on the Internet has a unique location, when you send an email to your friend Alice, “DNS servers” around the world inform webmail services and email servers where they should forward emails for the particular email domain Alice uses (“email@aliceonline.com”).

http://www.version-next.com/email-hosting/index.html

PHP Freelancer