PHP How To Send HTML Email with SMTP Authentication

Here’s a code snippet on how to send HTML email with SMTP authentication using PHP. You would have to download a library called PHPMailer as the mail() function of PHP does not support SMTP authentication. There is also other class that must be in the same location as class.phpmailer.php in order for the mail sending to work, smtp.phpmailer.php.

require_once(”class.phpmailer.php”);
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->IsHTML(true);
$mail->SMTPAuth = true;
$mail->Username = “username”; // your SMTP username
$mail->Password = “password”; // your SMTP password
$mail->Host = “smtp.host.url”; // SMTP server
$mail->From = $from;
$mail->AddAddress($to);

$mail->Subject = $subject;
$mail->Body = $body;

if(!$mail->Send()) {
  echo ‘Message was not sent.’;
  echo ‘Mailer error: ‘ . $mail->ErrorInfo;
} else {
  echo ‘Message has been sent.’;
}

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

Stupid Reply From A Hosting Provider’s Customer Support

Recently, I just bought my own domain. While doing some configurations to my blog, I was surprised that suddenly my domain was not working anymore. I ping’ed it and it was not responding, so there was something wrong. I kept surfing the web if there may be downtime issues with our clients. It took me some time to decide on checking out my host provider’s website and find out that they were doing system maintenance. I emailed customer support to inform them that they should have emailed the customers so that I, for one would know in the first place what was really happening in case I would check out my site. Here was the reply.

It would take longer for the issue to be resolved if we were to do that.

Now, how the hell would them emailing me delay the issue from being resolved? That was a pretty bad answer for a very simple question.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

The 500,000 GB MP3 Player

If this will be out on the market in time, it’s going to be a blast! Scientists at the University of Glasgow have created a nanotechnology breakthrough that could increase storage capacity by 150,000 times. This is going to be a whopper! Having soooo many songs without worrying about disc capacity limits. Videos won’t be a problem too, since they usually occupy a large chunk of the storage in our player. This would be even better if iPods are going to have capacities like these … let’s keep our fingers crossed and hope that soon … we will see them on our hands ;)

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

Facebook Privacy

A friend sent me an article regarding Facebook accounts. Once you have an account, there is no way to wipe your details inside their servers. Their system archives your information and keeps them and there is no way to wipe off everything in case you want to cancel your Facebook account. Not unless, maybe keep pestering customer service about it. This resulted in lots of users complaining about privacy as there is a tendency that your account with details could still be seen. Facebook’s reason was to give users the option to have everything back in place if they want to re-activate their account. The article mentioned other social bookmarking sites like Friendster having a delete button to wipe off everything in case the user wants it. I don’t believe so, because for all we know, our information is still being kept and there is just no way for us to actually see the profile. Whatever reason these sites have, there is only one solution to avoid complicating problems with your profile. Never divulge everything out to the public.

Comment from Facebook: “He also outlined some of the difficulties that Facebook has had as it has grown - and he wasn’t talking about server scalability issues, either. When Facebook was started, he explained, it was geared towards the US college student niche, making it easy to so the problems associated with that, as they didn’t have to worry about blowback from other types of people when an adjustment was made. Now that they’ve grown to 67 million active users, the diversity has made the site a whole different animal to manage.”

- This should not be used as an excuse. As a company, even when you have set a defined target audience range, your goals and views will always expand. Hence, you should be ready with situations like these. It’s a lame excuse that they brought out.

For the link to the article, click here.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...