Results 1 to 7 of 7

Thread: Multipart mail() function in PHP

  1. #1
    Join Date
    Mar 2010
    Posts
    203

    Multipart mail() function in PHP

    Hello,
    I tried unsuccessfully to send an email to multipart. The simplest is that I give you the exact contents of the header and the message, the rest is trivial. Message reaches me well but all in plain text, so how can I do this. If you have any solution for this then please let me know. Any help is appreciated. Thank you for your help.

  2. #2
    Join Date
    Nov 2009
    Posts
    335

    Re: Multipart mail() function in PHP

    Hello,
    Show us the php code, but look forward if you do not leave a space at the beginning in your text string is a common mistake that returns the header directly in the message. If you have tried something with your code then post here and what is the exact error you are getting? Also, if you post the error you are getting then it would be easy for us to solve your query.

  3. #3
    Join Date
    Mar 2010
    Posts
    203

    Re: Multipart mail() function in PHP

    Hello,
    Here is my code
    Code:
    <?php $de ="ex@test.com"; 
    
    
    $ bdnry=md5(uniqid(mt_rand())); 
    
    $ hdr="From:.To $; 
    $ hdr.="MIME-Version: 1.0N"; 
    $ hdr.='Content-Type: multipart / mixed; bdnry = "'.$ bdnry.'Rnn'; 
    
    / / Load variables each containing text:
    $ txt="Message in Plain Text"; 
    
    $ Texte_html=<b>'Hey!</b> <br> '; 
    $ Texte_html.=' <img src=http://address/image1.jpg> '; 
    
    / / Building the body of message to send
    $ Headers='-'.$ bdnry.'N'; 
    
    / / Part Plain Text
    $ Headers.='Content-type: text / plain; charset = "iso-8859-1" n'; 
    $ Headers.='Content-Transfer-Encoding: 8bit'.'Rnn'; 
    $ Headers=$ txt; 
    
    / / Separate Text Html Plain Text
    $ Headers.='-'.$ bdnry.'N'; 
    
    / / Part html text
    $ Headers.='Content-Type: text / html charset = "iso-8859-1" n'; 
    $ Headers.='Content-Transfer-Encoding: 8bit'."Rnn '; 
    $ Headers.=$ Texte_html.'Nn'; 
    
    / And finish the complete message
    $ Headers.='-'.$ bdnry.'- N'; 
    
    $ Resmail=Mail($ A, $ Topic, $ Headers, $ hdr)?>

  4. #4
    Join Date
    Nov 2009
    Posts
    359

    Re: Multipart mail() function in PHP

    Hello,
    The txt plain does not appear on your mail software, did you change the profile to see the message in "plain text"?
    Code:
    $ bdnry=md5(uniqid(mt_rand())); 
    
    $ hdr="From:.To $; 
    $ hdr.="NMIME-Version: 1.0N"; 
    $ hdr.='Content-Type: multipart / mixed; bdnry = "'.$ bdnry.'Rnn'; 
    
    / / Load variables each containing text:
    $ txt="Message in Plain Text"; 
    
    $ Texte_html=<b>'Hey!</b> <br> '; 
    $ Texte_html.=' <img src=http://address/image1.jpg> ';
    I think in this part of your code there is a mistake. Please check it

  5. #5
    Join Date
    Mar 2010
    Posts
    203

    Re: Multipart mail() function in PHP

    Hello,
    My email program (Outlook 2000 or 2003) is receiving the mails in html and plain text if the message was sent without the html. I have found in the options a check box that offers read all standard mail in plain text, but in this case it is the HTML text that I proposed in un-formatted text, but I still can not see the contents of $txt.

  6. #6
    Join Date
    Nov 2009
    Posts
    359

    Re: Multipart mail() function in PHP

    Hello,
    To return the message header in the mail is a problem of overhead, such as a shell. AC may come from parsing. Use double quotes, it's much more on headers for mail than just score. If you have any more problems then you can post here.

  7. #7
    Join Date
    Nov 2009
    Posts
    347

    Re: Multipart mail() function in PHP

    Hello,
    I emphasize that this kind of code must be clean, with no space at the beginning and end of strings sent to the mail server, backup peremptory source with a publisher who does not leave any garbage (using the text editor Windows in case of doubt) in case of repeated failure, it remains only to contact the technical assistance of the host in their joining the script and tell them the problem.

Similar Threads

  1. Replies: 5
    Last Post: 18-08-2010, 11:49 PM
  2. php function mail () not working within my account
    By Isiah in forum Software Development
    Replies: 6
    Last Post: 16-06-2010, 03:55 AM
  3. Sending a multipart MMS in Nokia N95 8GB
    By Ceadda in forum Tips & Tweaks
    Replies: 1
    Last Post: 30-01-2010, 06:30 PM
  4. How to send email using PHP mail function
    By killerboy in forum Software Development
    Replies: 2
    Last Post: 15-05-2009, 11:14 AM
  5. How to Multipart Avi Movie ?
    By Gluteus in forum Windows Software
    Replies: 2
    Last Post: 25-10-2008, 02:22 PM

Tags for this Thread

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
  •  
Page generated in 1,714,240,331.23890 seconds with 17 queries