SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mail script doesn't work on my server?!

    I have created a mail script with attachment using http://articles.sitepoint.com/articl...ed-email-php/5 as the basis of my code.

    The code sends an email with a blank attachment. The filename and type are both correct. However, the file size is wrong and the content is blank. This includes images and documents of all types.

    I tried it on an offsite server and It works perfectly. I didn't change ANY code when I tested offsite. I left everything as is on both servers.

    The headers are night and day. Seems like the server is stripping the header. Any ideas?

    Thanks for your help.

  2. #2
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dcp3450 View Post
    I have created a mail script with attachment using http://articles.sitepoint.com/articl...ed-email-php/5 as the basis of my code.

    The code sends an email with a blank attachment. The filename and type are both correct. However, the file size is wrong and the content is blank. This includes images and documents of all types.

    I tried it on an offsite server and It works perfectly. I didn't change ANY code when I tested offsite. I left everything as is on both servers.

    The headers are night and day. Seems like the server is stripping the header. Any ideas?

    Thanks for your help.
    I would recommend PHPMailer for sending mail via PHP.
    Sending attachment is easy with PHPMailer as you need not to worry about headers required.
    http://phpmailer.worxware.com/index.php?pg=examplebmail

  3. #3
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tired PHPmailer and had issues with it. I tried following the tutorials supplied but I didn't have all the files they showed in the tutorial. I even downloaded the files directly from the phpmailer site. I also tried Swiftmailer but there was an issue with the server when I tried to run parts of the code.

    I'm trying to figure out why our server is stripping the header and only allowing name and file type through.


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
  •