WordPress email and Godaddy part 2

The SMTP plugin doesn’t seem to like it when you put a Gmail address in the From field… or maybe Gmail doesn’t like being used in WordPress.  Hmm…

Anyway, I created an email address using one of my many Godaddy email hosting credits, forwarded the email to my Gmail, and put that email in the From field.  Worked fine (test returned "true" instead of "false").

Be sure to read Part 1 here.

Update 2009-08-28: While Gmail addresses do not seem to work in the From field, Google Apps email address do!

Pretty Permalinks with Godaddy Windows Hosting

Want pretty permalinks in WordPress?  Who wouldn’t?

However, if you are hosting your WordPress blog on a Godaddy Windows server, you need to one extra step to make this happen:

Copy and paste the following into a text file, save as “web.config”, and upload to the root of your WordPress blog.  If you already have a web.config file, be careful to just copy  the <rewrite>…</rewrite> tags and everything between them then paste inbetween the <system.webserver>…</system.webserver> tags.

<?xml version="1.0"?>
<configuration>
   <system.webServer>
      <rewrite>
         <rules>
            <rule name="Main Rule" stopProcessing="true">
               <match url=".*" />
               <conditions logicalGrouping="MatchAll">
                 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
               </conditions>
               <action type="Rewrite" url="index.php" />
            </rule>
         </rules>
      </rewrite>
   </system.webServer>
</configuration>

See the original info here: http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/

Aweber adds
tags to my RSS feed

Note: this article has been updated on Sept 3, 2009

I am using Aweber to email out a client’s blog entries.  The client is very particular about preserving his formatting.  He wants the entry to appear the same in both the email and his blog page.

Aweber’s Blog Broadcast Messages are fed by the item:description tags in an RSS feed from the blog.

The description tag is fed by the excerpt of that blog entry.  If none is defined, WordPress grabs the first few dozen words and ends it with “…” to indicate there is more but you have to go to the blog site to read it.

This was fixed this using the Advanced Excerpt plugin. Not only does this plugin copy the contents of the blog entry in its entirety, but also copies in the HTML code.  I set it to copy the first 1000 words. The blog entries are usually very short so this length works fine.  HTML tags are not counted in the 1000 words.

The next problem came when I set up the Blog Broadcast in Aweber. Extra lines were added to the emails I received.  In the source code of the message in my email client and at Aweber.com, I looked at the code of the messages sent out.  I found an extra <br /> tag that was not in the RSS code it was pulling from.

I made a copy of one of the messages that had went out, and removed all the extra <br /> tags and sent the message as a test.  No extra spacing this time.  This told me, the problem had to occur in the RSS import process.

My guess is that there is code to replace new line characters (n) with <br /> tags for those people who who just use plain text in their excerpts to maintain their formatting.

I asked Aweber about this and they are looking into the problem after I convinced them there was a problem.  I’m still awaiting on a response.

Meanwhile, in case they can’t fix it for some reason, I think I came up with another solution.  I am using Yahoo! Pipes to search the item:description tags of my RSS feed, and strip out the new line characters using regular expressions.  Regular expressions tend to tie my brain in knots, but a little research at Brooks Brayne’s blog showed me what to do.

yahoopiperemovenewline

Above, I’m telling pipes to search the item.description for all new line characters and replace them with nothing a space. Had to put a space in there because words would wind up mashed together.

The preview window in Pipes shows exactly what I wanted to see.

However, the code in the actual RSS feed for the Yahoo! Pipe is showing the left and right angle brackets as &lt; and &gt; which could be a problem.  I was afraid the &lt; and &gt; are going to appear in the email instead of the angle brackets. But email turned out perfectly.

Except for the plain text version. Aweber strips out all the HTML tags, and with no new line characters, the text doesn’t break into separate lines.

Next I will try searching for the <br /> tags and removing them as well as the </p> (end paragraph) tags and leave the new line characters intact.  This way, Aweber can insert their <br /> tags and the plaintext will look right.

Update 09/03/2009: Aweber appears to have fixed this issue and my fix caused a problem today.  The newline characters [/n] are now appearing in the emails.  I changed RSS feed back to regular blog feed instead of going through Yahoo! Pipes.  But I definitely need to keep Pipes in mind should I run into a similar issue again.

Update 09/04/2009: OK, it wasn’t Aweber.  I looked at the code coming out of Pipes and the [n] code is visible there.  I think the code changed somewhere, but Brooke Bayne’s blog now shows that the proper code for a new line is [n].  Or maybe it always said that and I messed it up… but then why did it work before?

WordPress Pretty Permalink Tip

If you have pretty permalinks turned on in WordPress and the permalink to one of your posts is not working, check the permalink for percentage signs (%).

What happened? If you composed your entry in Word or some other word processor, that program probably has an auto-correct feature that turns straight single (or apostrophe) and double quotes into curly quotes automatically (MS Word calls them smart quotes). Then you copied and pasted your title straight from the word processor to the title field of your blog. When you published the post, WordPress tried to convert the curly quotes to something more URL friendly, but not all web browsers and/or servers recogize that format.

Solution: The best thing to do is edit the permalink (either from clicking Quick Edit on the Edit Posts page or on the full edit page for that post, click the permalink edit button directly under the title field.  Then delete any % sign you see and the 2 characters after the % sign.  The new pretty permalink should work after that.

WordPress email and Godaddy

I have WordPress installed on a Godaddy Windows hosted server.  Email is not working to retrieve passwords.  I get this error:

The e-mail could not be sent.
Possible reason: your host may have disabled the mail() function…

Fix: Installed the WP-Mail-SMTP plugin. Set up my email address in the From, and set the outgoing server to relay-hosting.secureserver.net with no authentication.

And it worked.

I am also using the CForms plugin.  Under Global settings, I had to enter relay-hosting.secureserver.net to get it to email form submissions properly.

Update: Here are the settings I am using for the WP-Mail-SMTP plugin:

From Email: (I’m using a non-Gmail email address. See why here.)

From Name: (my name)

Mailer: “Send all WordPress emails via SMTP.” is checked

SMTP Host: relay-hosting.secureserver.net

SMTP Port: (blank)

Encryption: No encryption

Authentication: No authentication

Username: (blank)

Password: (blank)

Update 2009-10-25: If you are using a virtual dedicated server at Godaddy you will need to use k2smtpout.secureserver.net instead for the SMTP host.  Thanks to @koset for finding the info here: http://help.godaddy.com/topic/91/article/150