Problems sending mail with attachment |
[eluser]Armchair Samurai[/eluser]
I'm having a problem sending emails with attachments: There is a contact form which allows users to submit an email with an attachment. Everything seems to work fine, but when the email is received, it is malformed, with no trace of the original message and the base64 encoded attachment displayed. Here is the relevant code: Code: $this->load->library('upload'); The mail arrives with no problem and the headers seem to be normal, but the body always looks something like this: Code: This is a multi-part message in MIME format. As you can see, the text from the email is missing and the content boundary appears to be malformed. If I send the mail without the attachment, everything comes through with no problems. I have also checked to see if the file is being uploaded correctly and it appears to be normal. I'm using CI 1.7.2 and PHP 5.2.14. Does anyone have any ideas?
[eluser]umefarooq[/eluser]
try to debug you sent mail just put Code: $this->email->print_debugger(); also check your mail mailtype its going as text set it to html and check the result well debugger will help you more
[eluser]Armchair Samurai[/eluser]
[quote author="umefarooq" date="1285581425"]try to debug you sent mail just put Code: $this->email->print_debugger(); Ah... thanks for reminding me - I always seem to forget that function exists. It does get really weird though... print_debugger() gave me a relatively normal result: Code: Your message has been successfully sent using the following protocol: mail However, when the mail arrives at the destination, one of two things happen: 1) Gmail re-encodes everything from the "Location: In Japan" line in base64. Very weird. 2) Hotmail receives the message as is, but does not recognize the attachment - everything is displayed as plain text. I must admit I'm stumped - anyone have any idea what's going on? |
Welcome Guest, Not a member yet? Register Sign In |