LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-18-2018, 10:31 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
"send form" from a mobile phone


I made a little web page to collect multiple choice answers from students. It is just a collection of text box inputs and a "Send Form" button at the bottom. Later on I use python to parse the results.

When I try it on my laptop, "Send Form" causes Thunderbird email to open, all the data in there, I just click "send" and it's sent. Works great, even though it is very primitive!

When I do that on my phone, things are different. I get "the page can't be opened because the url is invalid"

The top of the form part of the web page looks like this:

Code:
<form method="post" action="mailto:myEmail@foxmail.com?subject=17week7" enctype="text/plain">
Do I need to put some url in there?

How might I get this to send from a mobile phone? (The students mostly just use mobiles)
 
Old 10-19-2018, 02:52 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
The mailto: URI is going to activate the default email setup on the device. It works on the laptop because you have email configured on the laptop.

Apparently, email is not configured on the phone, so the phone doesn't know what to do with the mailto: URI.

Typically the action of a form is a script on the server. That script then processes the data in the form. One of the things such a script can do is send an email. I often have the script update a database with the form data. The script can be a bash script, perl, PHP, python, etc.
Code:
action="/path/to/somescript"
Using a server-side script removes the dependency on the client-side configuration.
 
Old 10-19-2018, 05:48 PM   #3
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks, but the thing is, I need to make this work for all the students' phones, not just my phone.

I looked in the settings on my phone, but I can't find setting to do this.

We tried the web page on a Win 10 computer. A click on the 'send form' button brought up a window. Basically you just tell Windows your email and your email password, and it works.

There must be something like that for mobiles, whatever os, because this is a very common thing.
 
Old 10-19-2018, 08:13 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
When you do that in Windows 10, I believe that's effectively setting up the email client on the PC in order for the mailto:// URI to work.

Does it work on a phone that does have email already setup?

Again, to remove any dependency on the device or browser being used, call a server-side script to process the form data and email it instead. FormMail is a free perl script that works very well.
 
Old 10-19-2018, 09:53 PM   #5
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks again.

I tried downloading Firefox for mobile phones. When I clicked send, it asked me what mail program I wanted to open, so I clicked qqmail.
It opened OK, with my email and subject inserted, but NO DATA!

Thanks for the link, I've downloaded it. Now I'll try and get it to work!

I think I will have to find a new host for my little web page, this one was very cheap, but they don't help at all.

Quote:
Necessary Variables:
--------------------

$mailprog = '/usr/lib/sendmail -i -t';
For example, I wonder where they keep this? The server says it is 'Windows 2008'
 
Old 10-19-2018, 11:24 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Ahh. Can't help you there. You'll need to find a Windows forum, and probably a different email script.
FormMail might work on a Windows server running perl, but I don't know.

Your hosting company should also be a good place to get help.
 
Old 10-20-2018, 02:35 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Have you tried something like Google Forms instead?
 
Old 10-20-2018, 03:54 AM   #8
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Never heard of Google Forms, but thanks for the tip! I'll look it up.

Being in China does make google somewhat difficult. The government here wants to have control over all information which is made public. It is just the Chinese way. They've been doing this for 5000 years at least! Google refused to allow the government to censor their content. Google left Beijing.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: You Can Now Turn Your Old Moto G2 "Titan" Phone Into an Ubuntu Phone, Here's How LXer Syndicated Linux News 0 02-23-2018 04:02 AM
samsung mobile phone but require "Kies" to store my phones info. patcher Linux - Newbie 2 09-17-2012 04:52 PM
My "expect" script is not working... Won't "send" commands... edomingox Programming 4 04-02-2009 03:25 PM
LXer: Leading Linux phone partners form "Adcore-Tech" LXer Syndicated Linux News 0 08-01-2006 09:21 AM
form action ="?" ... where is my form posting to? verbatim Programming 2 05-23-2005 06:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration