Forums / Developer / Problem with sending mail attachments

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Problem with sending mail attachments

Author Message

Michaël Todorovic

Friday 29 October 2010 2:48:56 am

Hello,

In Exponential 4.2, I was sending emails with attachments to lotus notes and it was working.

Now in Exponential 4.3, I do the same but attachments are not shown in lotus. I see the email source instead (with mime and base64 encoded attachments). When I send the same email on other mail client (like zimbra or yahoo), attachments are shown correctly.

Here the code I'm using :(from http://ezcomponents.org/docs/api/latest/introduction_Mail.html#sending-a-mail-with-the-composer)

"
  1. <?php
  2. require_once 'tutorial_autoload.php';
  3. // Create a new mail object
  4. $mail = new ezcMail();
  5. // Specify the "from" mail address
  6. $mail->from = new ezcMailAddress( 'sender@example.com', 'Bernard Bernoulli' );
  7. // Add one "to" mail address (multiple can be added)
  8. $mail->addTo( new ezcMailAddress( 'receiver@example.com', 'Wendy' ) );
  9. // Specify the subject of the mail
  10. $mail->subject = "This is the subject of the example mail";
  11. // Create a text part to be added to the mail
  12. $textPart = new ezcMailText( "This is the body of the example mail." );
  13. // Create a file attachment to be added to the mail
  14. $fileAttachment = new ezcMailFile( "~/myfile.jpg" );
  15. // Specify the body of the mail as a multipart-mixed of the text part and the file attachment
  16. $mail->body = new ezcMailMultipartMixed( $textPart, $fileAttachment );
  17. // Create a new MTA transport object
  18. $transport = new ezcMailMtaTransport();
  19. // Use the MTA transport to send the created mail object
  20. $transport->send( $mail );
  21. ?>
"

What can I do ?

Thank you