Tag Archives: e-mail

How to Locate which Ports You can Send out on via SMTP when using a GoDaddy E-mail Account Software & Sites 30 APR 2012

A port is just a port, and just because there is a standard one that is used by something, it doesn’t mean you always have to use the default port for doing that something. Enter sending out an e-mail message via SMTP when using a GoDaddy e-mail account.

Although GoDaddy restricts incoming e-mail to ports 110 and 995 (SSL), outgoing SMTP ports (usually via its smtpout.secureserver.net server) are a little more open. This tutorial will teach you how to find out which ports are available for you to use in your e-mail sending application.

First, login to GoDaddy’s site (http://www.godaddy.com) and click on the “Email” button on the main green menu bar. If you have any active e-mail accounts, they will be listed, and to the right of each entry you will find a green launch button. Clicking on this will open the Control Center.

Once in the Control Center, you’ll see your e-mail addresses listed under the Email Plans folder. The addresses are laid out in a table, with the columns, Address, Size, Relays, Attributes, and Actions.

In the Actions column you will see a Tools icon. Click on it to launch the Info Center.

The Email Info Center is a one-page view of your e-mail address account settings. Under the fieldset entitled “Email Server Settings”, you will spot a label “Outgoing server (SMTP):”, giving you the server details to use, as well as a list of available and open ports. Score!

So if you want to move away from the standard port 25 and perhaps now send out on port 80 via your PHPMailer-using PHP script, your code would look like this:

$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtpout.secureserver.net"; // specify main and backup server
$mail->Port = 80; // new port
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "username@mydomain.com"; // SMTP username
$mail->Password = "mypassword"; // SMTP password

Nifty.

How to Add a CC E-mail Address with PHPMailer Programming 02 APR 2012

I’ve moved to the fantastic PHPMailer PHP class to handle all my e-mail send outs for my projects and have thus far been quite impressed by the ease-of-use and robustness of the class.

Today’s code snippet will show you just how easy it is to add CC (“carbon copy” or “courtesy copy” depending in what era you were born!) e-mail addresses to a e-mail send out, thus saving computing time by pushing out a single mail send instead of a number of separate ones for each attached address (well technically, we’re just foisting all the work onto the SMTP server, but still, less work that the web server needs to do, i.e. a win for us!).

In code:

//create the mail class and fill in all the required settings
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.server.net";
$mail->SMTPAuth = true;
$mail->Username = "username@domain.com";
$mail->Password = "password1";
$mail->From = "username@domain.com";
$mail->FromName = "Software Simian";
$mail->AddAddress("targetguy@domain.com", "Target Guy");
$mail->AddReplyTo("username@domain.com", "Software Simian");
$mail->Subject = "Subject";
$mail->Body = "Message";
$mail->AltBody = strip_tags("Message:);
 
//and now for the actual bit of adding multiple CC e-mail addresses
$mail->AddCC("extra-address1@domain.com");
$mail->AddCC("extra-address2@domain.com");
$mail->AddCC("extra-address3@domain.com");
 
//and send. Now was that not easy?
if(!$mail->Send()){
    $resultstatus = 'Failed';
}

The code above will result in a mail being sent out to four addresses instead of just the main specified address.

Nifty.

PHP and PHPMailer: How to Check if Your Mail Send Failed CodeUnit 21 DEC 2011

PHPMailer is a great little mail sending workhorse class for PHP, widely expanding on the regular PHP mail() function and particularly easy to make use of, making it a personal favourite of mine.

Anyway, to check whether or not your mail send was successful when using PHPMailer, all you need to do is check the Boolean variable returned by the Send() function, and if false, check what the error message contained in ErrorInfo is.

In practice:

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp1.example.com;smtp2.example.com";
$mail->SMTPAuth = true;
$mail->Username = 'smtpusername';
$mail->Password = 'smtppassword';

$mail->AddAddress("email@example.com");
$mail->Subject = "Test 1";
$mail->Body = "Test 1 of PHPMailer.";

if(!$mail->Send())
{
   echo "Error sending: " . $mail->ErrorInfo;
}
else
{
   echo "E-mail sent";
}

As simple as that! :)

PHP: How to Send a PDF File Attachment via E-mail CodeUnit 08 JUN 2011

I’ve moved to the fantastic PHPMailer PHP class to handle all my e-mail send outs for my projects and have thus far been quite impressed by the ease-of-use and robustness of the class. Today I’ll quickly note how you can send an attachment (like a PDF file for example) with a mail send out.

As you can see from the code snippet below, attaching a file is as simple as passing a valid file path to the file to be included to the AddAttachment() function call and then hitting Send().

//create the mail class and fill in all the required settings
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.server.net";
$mail->SMTPAuth = true;
$mail->Username = "username@domain.com";
$mail->Password = "password1";
$mail->From = "username@domain.com";
$mail->FromName = "Software Simian";
$mail->AddAddress("targetguy@domain.com", "Target Guy");
$mail->AddReplyTo("username@domain.com", "Software Simian");
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "Subject";
$mail->Body    = "Message";
$mail->AltBody = strip_tags("Message:);

//and now for the actual bit when it comes to adding a file attachment to an e-mail
$mail->AddAttachment("/home/username/fileToUpload/report.pdf");

//and send. Now was that not easy?
if(!$mail->Send()){
    $resultstatus = 'Failed';
}

Couldn’t be any simpler, could it? :)

Related Link: http://phpmailer.worxware.com/

Strange Naruto Obsession Blogging 05 NOV 2007

You get some very… strange people in the world I think. Some people who just aren’t…right. A good example is the following mail I received via the contact form from this blog over the weekend:

(I’ve blanked out some identifying info with a * just because I don’t want to be nasty)

Name: cody meyer
IP Address: 71.79.*.*(cpe-*-*-*-*.cinci.res.rr.com)
User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322)
Email: *@aol.com
Subject: naruto

Comment:

On Friday, November 2, 2007, 11:54 PM, cody meyer wrote:

hi im in love wit naruto and how do you make a portal to narutos land

I haven’t replied to this mail (I normally reply to everything I receive), mainly because I am stumped on what to say. My first answer would be “…with jellytots”, but this might be a kid and I don’t want to be the guy who breaks the news that there isn’t a Santa or that the Easter bunny isn’t real – I don’t like those guys.

Actually, I AM hoping that this is a kid – otherwise America’s education system has a lot to answer for!

naruto, kakashi, sasuke, and sakura

Return to Sender Blues Tech News 13 JUN 2007

This morning it was brought to our attention that no external mail was reaching us (UCT) and instead was bouncing back to its senders with the message of the UCT mail server being blacklisted. Obviously this meant that the guys at UCTs main IT support department needed to spring into action (mainly to avoid being blamed for the problem like they always do whenever something goes wrong). Well at least this time is appears that it wasnt their fault. In fact, it appears that the problem doesn’t even lie with UCT’s servers for a change.

Thank you hackers for once again making the ordinary mans life more difficult than what it should be :(

This is the notice message that was sent out:

What has happened?

Companies around the world subscribe to spam blocking lists to reduce the amount of spam entering their organisations. – These spam blocking lists show known spammers. – Companies who subscribe to the spam block list will then prevent the delivery of mail if it comes from one of the known spammers shown on the block list.

However, one of the well-known spam block lists has been compromised (hacked) and a number of major email service providers have been falsely added to the spam block list. – These service providers include for example, mweb.co.za, is.co.za, wits.ac.za, vodamail.co.za, absamail.co.za, hotmail.com, gmail.com, yahoo.com. – This means that mail being sent from those service providers is being bounced as potential spam, even though the majority of the mail is not in fact spam. – This is affecting mail delivery world wide.

The problem is NOT caused by UCT, nor can UCT do anything to correct the problem.

What is ICTS or UCT doing about getting mail into the organisation?

In order to accept as much legitimate mail as possible, we have reduced the spam security on our email system. Unfortunately, this will inevitably cause more spam to be accepted as well. – It also increases our vulnerability to attack by malware that can now enter the organisation. – Please make sure that you follow the normal safety guidelines about opening mail and attachments. – (See: “Protect yourself from Phishing attempts” on the ICTS website homepage (www.icts.uct.ac.za) for tips on what to look out for.)

stylish sending e-mail  from a tablet