Put the email output as mail attachment

Home Forums Quform WordPress Put the email output as mail attachment

This topic is: resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24404
    sdus
    Participant

    Dear forum,
    I have designed my notification mail in version 2.

    Now I need the same content (from the html mail) as attachment (e.g. txtfile). So, that the mail come as mail AND attachment.

    How I can do this?

    MANY thanks!

    #24436
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #24439
    sdus
    Participant

    Hi Ally,
    many many many THANKS!

    How is the solution, is I have more than 1 form? It means, that this works for all forms which I have.
    But only the correct (choosen form at the moment) forms is sending.
    Than I must copy and paste this code and set the correct ID?

    THANKS again!

    #24476
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #24829
    sdus
    Participant

    Dear forum,
    how I can save the output of the form into the file as uft-16le?
    Is it possible?

    Many thanks for all answers!!!

    • This reply was modified 6 years ago by sdus.
    #24864
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #24875
    sdus
    Participant

    Hi Ally,
    many thanks!
    The utf-16le is bad, because it does not solve my problem. I thought it solves my problem:

    In the mail all german umlauts / characters (ä,ö,ü) are correct. The code from reply 24476 works fine, but all special charakters / umlauts are bad: ( ü=ü ) in the file (shown via hex-editor). Only the file, not the mail.

    The file attachment.txt get the unitext from the mailbody. in the utf-16 now Im missing the first 2 bytes (see picture)

    Which code I must add to reply 24476 (above), that I get the correct letters in the file and the hex-editor (implicit utf-8) or add the 2 bytes to utf-16?

    Many, many thanks for all the fine help!!!!!!!!!!!!!!!!!!!

    • This reply was modified 5 years, 12 months ago by sdus.
    • This reply was modified 5 years, 12 months ago by sdus.
    • This reply was modified 5 years, 12 months ago by sdus.
    • This reply was modified 5 years, 12 months ago by sdus.
    • This reply was modified 5 years, 12 months ago by sdus.
    • This reply was modified 5 years, 12 months ago by sdus.
    Attachments:
    You must be logged in to view attached files.
    #24884
    sdus
    Participant

    Problem solved.

    I must use

    add_action('quform_pre_send_notification', function (PHPMailer $mailer, Quform_Notification $notification, Quform_Form $form) {
    $mailer->addStringAttachment(iconv('UTF-8', 'UTF-16', $mailer->Body), 'attachment.txt');
    }, 10, 3);

    to get the output with BOM.

    Thanks for the perfect support!!!!!!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy