Forums

Howto send a file to the user (showing save file dialog)

miki 18 Nov, 2008
Great! It works! Thankyou so much! I have setup the form so that it sends a confirmation mail with the attachement to the user who filled out the form and one to the admin, so he knows who submitted the form. But both have the attachement in their mail! How/What do I have to change so that only the user gets the attachement, but not the admin (Mailbox of admin would overflow maybe otherwise)?

Cheers!!!
*Miki
GreyHead 18 Nov, 2008
Hi miki,

You'll need to send separate emails to the two of them and empty the attachments array before sending to the admin. You may need to hand-code the second email to do this, you can copy the code that CF uses.

Bob
Max_admin 18 Nov, 2008
Hi miki,

show me the code you used to add the attachment to the emails and I will guide you!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
miki 19 Nov, 2008
I made it work. I put this into chronocontact.php:


if ( $noAttachmentToAdmin != "" && in_array($noAttachmentToAdmin,$recipients) ) {
	$attachments = 0;
	$mainframe->enqueueMessage('Attachments was not sent to '.$noAttachmentToAdmin.' because value noAttachmentToAdmin was set.');
}


and this into onSubmit() code:


<?php
$attachments['file1'] = "absolute path to attachment";
$noAttachmentToAdmin = "admin@email.com";
?>


Was that a good way to solve the problem?

Cheers!
"Miki
Max_admin 19 Nov, 2008
Hi Miki,

hacking the file is not the best way, but you got it working, I think that the code doesn't give enough flexibility anyway to do what you need, I will add this to the todo list!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
roseline43 22 Feb, 2009
I'm trying this modification but when I put the code below, the user don't receive the attachment either.

Any help?

thanks,

Roseline
Max_admin 22 Feb, 2009
Hi Roseline,

Please explain what are you trying to do and we may find someway without a hack!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.