RSS

How to send emails from Bluehost

I struggled quite a bit in order to write a perl script to send mail and put it up on blue host. Hope this article will help others in the same situation.

At first I tried to use the Email::Send::SMTP::Gmail to send mail. However when I put it up on the bluehost server I realized that this simply does not work. To add to that the error logs do not help to identify the problem. Googling around a bit I realized that bluehost does not allow applications to send mail through GMAIL or any other external mail servers. One would have to configure bluehost’s own mail server to send mail. And this is how you do it.

 

 

Click on email accounts and then create a email id and set a password.

 

 

Once you have done the above step, you have a working email id . Just to check if everything is fine – go back to the control panel home page and click on web mail. Then type in the required fields and you must be logged in.

 

Now that you have you have got a working email all that is left to do is to use it.

 

The incoming server is always named as mail.yourdomainname.com. It operates on port 465. Now that we have all the required data we can simply go ahead and wrap this up into a perl script.

The module I recommend is Email::Send::SMTP::Gmail


#!/usr/bin/perl -w
use strict;
use warnings;
use Email::Send::SMTP::Gmail;
my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'yourdomainname.com',
-login=>'id@yourdomainname.com',
-pass=>'yourpass',
-debug=>'1');
$mail->send(-to=>'id@host.com',
-subject=>'Hello!',
-charset=>'KOI8-R'
-verbose=>'1',
-body=>'Just testing it'
);
$mail->bye;

9 Responses to “How to send emails from Bluehost”

  1. I relish, cause I discovered just what I was having a look for. You have ended my four day lengthy hunt! God Bless you man. Have a great day. Bye

  2. […] Recent CommentsSmtp2go Worldwide SMTP Email Service For Travelers on How to send emails from BluehostArchives […]

  3. Thanks – Enjoyed this update, how can I make is so that I get an alert email whenever you publish a new post?

  4. Dean Mutty says:

    There’s noticeably a bundle to learn about this. I assume you made certain good points in features also.

  5. I am always invstigating online for articles that can benefit me. Thank you!

  6. You are a very smart person!

Leave a Reply

Blue Captcha Image
Refresh

*