SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist rhysboy84's Avatar
    Join Date
    May 2007
    Location
    Colwyn Bay, North Wales, UK
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why is the last character being dropped?

    Hi guys,

    I have written a wordpress plugin that sends email through wordpress, and - whilst it works correctly, it drops the last character from the "From: " name (an example can be seen here, it should be spelt "Wynne", not "Wynn").

    It is correct in the settings in the back end, but only when it gets pulled in to the site to send email, does it drop the last character (which happens for various other things such as "Webmaste" etc.)

    Here is the code where I think the problem is:-

    PHP Code:
    $to=$email;

        
    $siteurl get_option('home');
        
    $siteurl addLastCharacter($siteurl);

        
    // Your subject

        
    $subject=get_option('wp_email_capture_subject');

        
    // From

        
    $header "MIME-Version: 1.0\n" "From: " get_option('wp_email_capture_from_name') . "<" get_option('wp_email_capture_from') . ">\n"

        
    $header .= "Content-Type: text/plain; charset=\"" get_settings('blog_charset') . "\"\n";

        
    // Your message

        
    $message.= get_option('wp_email_capture_body') . "\n\n";

        
    $message.= $siteurl ."?wp_email_confirm=1&wp_email_capture_passkey=$confirm_code";


        
    // send email

        
    $sentmail wp_mail($to,$subject,$message,$header); 
    Any ideas on how the last character gets dropped?

    Any help would be greatfully appreciated
    I'm Rhys Wynne & I blog at Winwar Media
    WP Email Capture: Free Email/Ebook Marketing Wordpress Plugin
    UK Based SEO? Tweet Your Location to #ukseohere!
    | My Brand New Brand | Twitter |

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What is the get_option() function?
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Evangelist rhysboy84's Avatar
    Join Date
    May 2007
    Location
    Colwyn Bay, North Wales, UK
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    get_option is a wordpress function:-

    http://codex.wordpress.org/Function_...nce/get_option

    The problem isn't there, as when I echo get_option('wp_email_capture_from_name'), it displays the full name correctly.

    The plugin files are at home, so I'll have a play around with it later and keep you updated
    I'm Rhys Wynne & I blog at Winwar Media
    WP Email Capture: Free Email/Ebook Marketing Wordpress Plugin
    UK Based SEO? Tweet Your Location to #ukseohere!
    | My Brand New Brand | Twitter |

  4. #4
    SitePoint Evangelist rhysboy84's Avatar
    Join Date
    May 2007
    Location
    Colwyn Bay, North Wales, UK
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed it, a silly little bug.

    In the line:-

    PHP Code:
    [B]$header "MIME-Version: 1.0\n" "From: " get_option('wp_email_capture_from_name') . "<" get_option('wp_email_capture_from') . ">\n"
    Instead of . "<" ., it should be . " <" .

    Silly space causing me 2 days of grief!
    I'm Rhys Wynne & I blog at Winwar Media
    WP Email Capture: Free Email/Ebook Marketing Wordpress Plugin
    UK Based SEO? Tweet Your Location to #ukseohere!
    | My Brand New Brand | Twitter |


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •