Sending an attachment to an emailadres that a customer fill in
Autor: Jos S.
Visited 2150,
Followers 1,
Udostępniony 0
I have Website X5 v11 and am very pleased with it.
The website I made with Website X5 is www.motor-routes.eu. At this moment people can download GPX routes and import it into their Garmin or TomTom navigation.
What i like is to make an option to email a GPX route. Next to the download option i would like to make a new option. If people click on this option they should get a question to fill in their email adres. After they click on the "Send" button an email is send with an GPX attachment. This attachment can be different because there are many GPX routes on the site
I have an SMTP server with I can use.
In version 11 there is no option.
Do you know an solutions? I can import HTML code....
Hope to hear from you.
Jos
Posted on the
Hello Jos
There could be several ways to do this. I will try to mention a couple of them.
1- You install PHPmailer on your server. This will be the easiest way to send mails ( you could instead use SwiftMailer or Zend_mail ).
Then you create a php file with a little bit of code - like this :
$email = new PHPMailer();
$email->From = '***';
$email->FromName = 'Your Name';
$email->Subject = 'Message Subject';
$email->Body = $bodytext;
$email->AddAddress( '***' );
$file_to_attach = 'PATH_OF_YOUR_FILE_HERE';
$email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' );
return $email->Send();
For every file you want to send to the user, you make a link to the php-file with the code for that file.
2- The X5 ver 14 can send mails via the shop when having digital materiel. You could have the price as 0 EURO so the material is free.
Disadvantage with this solution - it is not ver 11 ( you have to upgrade ) and the user only gets a mail with a link ( so what is the point in this ? ) and you have to accept the "order" before a mail is sent. I don't think this is a solution.
I would like, if you could explain why you want the user to receive a mail instead of the user just clicking of a link and then get the download immediately - that seems for me to be the easiest way. Both for the user and you.
If it is because you want the users e-mail address, then there are other and easier solutions. Could you please explain why there is the need for sending the file as an attachment in a mail.
Kind regards
John S.
Autor
Hello John,
To download the GPX file is what I do now on my website. That works perfect but older people find it difficult to find the file on the PC and to copy (or import) it to the Garmin or TomTom. But that is not the most important reason. I"am testing some navigation software on my smartphone. I think that will be the future. The easiest way to get the GPX file on the smartphone is through an email with an gpx attachment.
I can put some HTML code in my Website X5, I know how that can be done, but can I put PHP code into an Website X5 page? I "am not a programmer, that why I use Website X5.
I can make a button and when you click on it HTML code is executed and then my customer should fill in his emailadres. After that an standard email and the gpx file will be send to that emailadres. I"am not interested in the emailadres.
In my case what is the easiest way to get this done?
Thanx
Jos
Simple method, you send in response all links to the gps files.
Complex procedure, create a gsp-route an email form and send as an automatic answer exact the link to this gps-route.
JJ.
Hello Jos
As JJ tells it will be the easiest to send the links in a mail. If you have really many links then you could maybe group them.
Then you have a mail-option for every group of GPX files and then send a mail with all links for this group.
You should know, that an attachment and a link is not the same, but much the same. By using links, users will ( depending on the settings in the users browser ) maybe just get a download. In the mail-program there is an option where you can save or open. In the browser this has to be set.
But you can easily make a test and see if this solution with the links in a mail, will fit your needs.
You don't have to make anything in X5 at all for a start. You could just in a mailprogram create a mail ( and send this to yourself ) with some links to some GPX files and see how this functions.
John S.
Autor
thank you all for the usefull tips. I"ll try them next week and let you know
Jos