Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
GGANG
Experienced
Topic Author
Posts: 122
Joined: 02 Feb 2012, 11:01

A File Attachment For Email Form

31 Dec 2015, 01:10

Hi Karl,
Do you have a solution for the attachment files?
I want to make another form for different purpose.
Happy New Year 2016! :D
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: A File Attachment For Email Form

31 Dec 2015, 23:44

We plan to implement custom forms at some point, but this is a few months away. Attaching a file is also possible, but how were you thinking of using it? The contact form sends to a single email, so will you be sending the same attachment to the same address?

If you open the file app/x3.mailer.php, you will find at the bottom some example code to attach/embed files:
Code
// ATTACHMENTS AND IMAGES
//$mail->addAttachment('images/phpmailer_mini.png');
//$mail->addAttachment('/var/tmp/file.tar.gz');
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); 
//$mail->AddEmbeddedImage('logo.jpg', 'logoimg', 'logo.jpg'); // attach file logo.jpg, and later link to it using identfier logoimg
//$mail->Body = "<h1>Test 1 of PHPMailer html</h1><p>This is a test picture: <img src=\"cid:logoimg\" /></p>";
 
User avatar
GGANG
Experienced
Topic Author
Posts: 122
Joined: 02 Feb 2012, 11:01

Re: A File Attachment For Email Form

19 Aug 2017, 04:58

Hello Karl,

In V.23.0 I could not find x3.mailer.php
I want to make a form with attachment file e.g. jpg, png  
How to add the code and a content web page?

Thank you and Have a nice holiday!   :thumbsup:
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: A File Attachment For Email Form

19 Aug 2017, 09:40

GGANG wrote:In V.23.0 I could not find x3.mailer.php
It's now inside x3.api.php.
GGANG wrote:I want to make a form with attachment file e.g. jpg, png  
How to add the code and a content web page?
If you just want to attach a static image to every email, you can easily edit the code.

But if you want to add an upload form (which I suspect), this is nothing I can write for you here now. Not only do you need an upload form (preferably multi-file javascript), but you will need a folder where uploads are stored. Also, it needs to be strictly secured so that users can't upload scripts to hack the website. Finally, the email form must dynamically be able to attach specifically the uploaded image(s) into the email.
 
User avatar
GGANG
Experienced
Topic Author
Posts: 122
Joined: 02 Feb 2012, 11:01

Re: A File Attachment For Email Form

19 Aug 2017, 19:42

No, I don't want to add upload files.
I want attachment file like the email client.
The purpose is for someone attach an image file of the payment slip to confirm their payment. (Bank transfer)
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: A File Attachment For Email Form

19 Aug 2017, 23:40

GGANG wrote:No, I don't want to add upload files.
I want attachment file like the email client.
The purpose is for someone attach an image file of the payment slip to confirm their payment. (Bank transfer)
How are they going to attach a file without uploading an image? There is no "attach image to email" from a web form ... It involves uploading an image, so the emailer can attach the uploaded image to the email.