Sunday, October 28, 2012

Direct Mail TYPO3 "content could not be fetched" solution

Possible solution for "The plain text content could not be fetched.The HTML content could not be fetched."

TYPO3 is a good CMS and a lot of people seem to be using it. One famous and handy extension is the direct_mail which allows, among other things, to send newsletters.

Recently I was trying to add this extension to my TYPO3 instance but when I tried to make a newsletter based on a page, internal or external, I would always get "HTML content could not be fetched".

There seems to be multiple reasons for this issue but I'll focus on the one that I had and required code debugging.

I was using the latest direct_email version 3.02, had "allow_URL_fopen=ON" and "use CURL"  activated on TYPO3’S install tool. If you want to change allow_URL_fopen do it in you php.ini.

My solution for the direct_mail extension "content could not be fetched" issue was

adding the IP mapping to the /etc/hosts file on the server...just wrote 192.168.101.31 my domain on /etc/hosts file....the IP was the server's network IP.
/etc/hosts
server_ip             mydomain.com

Why is this necessary:

direct_mail extension uses CURL to fetch the newsletter's page and as such it tries to connect to an address.and if the IP machine isn't mapped on the hosts file it will fail.

What I don't get is why direct_mail doesn t provide more info besides " The plain text content could not be fetched. The HTML content could not be fetched"

If you have any other solutions for this issue or if this didn't help let me know by adding coments.

4 comments:

  1. Including the static template(s) (answer 2 on http://stackoverflow.com/questions/11879046/is-permission-of-typo3temp-affect-in-fetching-page-of-newsletter-using-direct-ma) also helps

    ReplyDelete
  2. Hi,
    I still get the error...

    Do I need php-curl (my webserver ist unix-based and supports curl in command line),
    but does typo3 need php-curl too?

    Thanks!

    ReplyDelete
  3. If your using external pages, it just can be that your URL is too long, so trying shortening the path / filename.

    ReplyDelete