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/

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

WordPress on Deluxe Godaddy Hosting

Problem: I have set up several WordPress sites on a Deluxe Hosting account on Godaddy where I set up a domain to point to a subfolder on the hosting server.

Ex: http://www.mydomain.com points to http://www.accountdomain.com/mydomain

Now when I put WordPress in /mydomain, I log into http://www.mydomain.com/wp-login.php, then try to save some settings, and the page redirects to the login page at http://www.mydomain.com/mydomain/wp-login.php?<querystring> which then wants to redirect to http://www.mydomain.com/mydomain/whateverpageIwason.php instead of just http://www.mydomain.com/whateverpageIwason.php.

Get all that?

I tracked down the culprit to the wp_referer_field function defined in /wp-includes/functions.php.  The server is reporting like the main URL is http://www.accountdomain.com instead of http://www.mydomain.com.

So here comes the dirty hack in blue below.

function wp_referer_field( $echo = true) {
    $ref = attribute_escape( $_SERVER['REQUEST_URI'] );
    $ref = str_replace("/mydomain", "", $ref);
    $referer_field = '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />';

    if ( $echo )
        echo $referer_field;
    return $referer_field;
}

If the string “/mydomain” is found in the referral string, I strip it out.

I am aware of a way to fix this by editing the .htaccess file, but I don’t think Godaddy permits access to it.

I’m open to ideas.  I’m using WordPress 2.7

Update 8/24/2009:

It’s not a bug… it’s a feature.

Don’t go and try to change the code like I did, folks.

The fix is very simple:  On the General settings page, leave the WordPress address (URL) field as “http://www.mydomain.com/mydomain” and change Blog address (URL) field to “http://www.mydomain.com”.