I just realized that I don't have a answer to this question, when I'm talking some friends we can't find the best simple solution to do this.
Can I send a dynamically body, from a form with a prefixed subject? My question is about the most simple solution.
[]'s
You cannot do this in general without some server side help.
Plain html does not offer support for it.
Usually a link as proposed by Simon will do the trick, but this will not work for everyone.
Javascript and Java client scripting suffer from the "same origin" limitation, meaning that you have to deliver to the same server, unless the user jumps through hoops to allow the script to connect to other hosts.
There are many scripts available to do this.
You can launch the user's email program using a mailto link along with several paramaters:
mailto:foo#example.com?subject=hi&body=hello,%20world!
However, a lot of people use webmail nowadays, for which it won't work - so the best option is to avoid using email. If you want feedback and don't want to host such a script on your own server, you can use a service such as PollDaddy or SurveyMonkey for this. If you want to encourage users to share a page with friends, ShareThis supports email.
Related
I have taught myself HTML/CSS and some JavaScript as a hobby, and have reached the point where I am comfortable building a clean simple website. The company I work for (we do nothing related to coding) has a website that is quite outdated so naturally I saw this as an opportunity for my first live site. I approached my Managers at work to take a look at my first mock up and they loved it and want me to revamp our current site.
The one concern they have with me being a rookie is the issue of web security. Essentially they want to make sure that the website I build leaves no vulnerability for someone to hack through our server, start editing our website, etc.
There are no interactive components to the current website. I plan to build this website with only HTML and CSS, and perhaps add some JavaScript later down the road once I progress in my learning a bit more. There are no account logins or areas to enter personal information anywhere on the site.
My question comes down to this -- what can I do to ensure that the website I build is not leaving our company vulnerable? I have done a lot of searching around Stack Overflow and other websites but I am not confident I am finding the correct information.
Details that might make a difference:
Our company website is hosted through godaddy.com
Our website is currently on Wordpress, but I will probably not use Wordpress for the new website
I greatly appreciate all of your help!
since there should be no direct interacting with the server ex PHP and AJAX only HTML CSS and js there should be no security issue, as js and HTML can't edit/delete/read server files, only server-side programming can. eventually you may want to invest in PHP almost no website is complete without PHP or AJAX. take me for example, I used to use just HTML, CSS, and js. then I wanted to do more.. log form answers to a file, show different pages based on the query string. these things are virtually impossible in a HTML, CSS, and js only environment. I would also recommend atleast getting free protection from cloud flare.. they give free shared hosting wildcard SSL, and free DDOS protection, granted for a business you might want to invest a little more than free but free would be a good starting point
also you could pay someone to test the vulnerability of your company, take for example OurMine. a legal hacking group.. you pay them to test your security and they do just that. (they claim they don't log anything that they get) otherwise there might be vulnerabilities you may not be aware of
When you are concerning about just AJAX call, I would help you out for following suggestion regarding "Function access rule from AJAX".
By adding "_" as a prefix for Function name, we can prevent function to be called from The Web publicly. This is the best practice when we need some specific function to be accessed via AJAX only.
Kindly, refer my answer given in other question.
[Website Security: How to learn?
How would I go about sending information from my bootstrap modal form to an email account? I have been looking around and seeing people using php. Is there no way to do this without php? And if so how would I go about starting this since I have no clue how to use php? I am trying to build my own website and would like to add this feature.
You cannot do this without server-side code (PHP for example).
Here's another post with a solution: https://stackoverflow.com/a/11419187/881011
Im almost confident php is required. And im pretty sure it would go through you hosting plan (godaddy, host gator, etc) you will have to check out you hosting plan. I've never done it my self but from my understanding there is a way and php is required.
:) host hope this helps.
I'm attempting to make a mail client that is HTML5/JS only where users would have to define their mail server and credentials.
I've surfed google leading to dead ends and figured that this is the next best place (or superuser.com).
I was thinking of using HTML5 WebSocket if I could to make the connection to the server but I don't know enough of smtp, imap, or pop3's architecture to understand how javascript could pass the args and perform what I want it to do.
PHP cannot be involved in this project otherwise I wouldn't be asking the question.
Any help in locating this would be fantastic.
Nothing is impossible. Except this.
In standard HTML or JavaScript, you can't make raw-socket connections, which is what you'd need to speak any of the protocols you've listed. The WebSocket API doesn't help you, because the server must also speak WebSockets, and mail servers don't. This is actually all a good thing, though. Imagine if you visited a random website and it telnetted to your home router, setting it on fire and burning down your house. That's what websites would be able to do if they could initiate plain TCP socket connections.
You have a few options I can think of, neither of which involves building a webpage. (And to be clear, you didn't say your project had to be a webpage; you merely said HTML/JS, so these are indeed legitimate options.)
First is something like node-webkit. As the readme says, "You can write native apps in HTML and Javascript with node-webkit." You'll still have to distribute it as a native app, because that's what it is.
Second is a Chrome app, specifically using the chrome.socket API. But have fun writing a TLS layer over those sockets, which you'll find is a requirement for almost any mail server these days. If you succeed in doing that, you'll be able to distribute your mail client in the Chrome Web Store, where I assure you an email client will be quite popular.
Third, write a webserver that operates locally, so your users will visit something like http://localhost:9999/mail in their browser. This will be a real pain to distribute, but you can use almost any technology you want.
I'm sure there's a fourth valid option, and someone else can chime in on that one.
Best of luck.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
PhpMailer vs. Swiftmailer?
I have always used PHP's built in mail() function and it has always worked for me without fail and does the job I want it to.
Now some maybe thinking 'Why fix something that isn't broke ?'.
My answer to these in case someone asks is:
I have never used a framework before if that's what they are classified as or perhaps they are called a library I don't know.
I want to start using one and have looked over the documentation and both seem very easy to use.
As I implement new features into my site, my site is depending more on sending emails etc meaning PHP's mail() function is not up to the job any more.
They would be easier to use when dealing with advanced things like attachments, html and text versions etc; that would otherwise be difficult or impossible using PHP's mail() function.
I have never used SMTP, and I have looked into it and I can see I can use it along with SSL on my hosting package. After plenty of reading it seems that not only is SMTP more reliable and more widely used, emails are less likely to be marked as spam, using either of the frameworks will improve performance, reliability and more secure because it uses SMTP with SSL.
Now I am not sure what the other benefits are using SMTP, maybe someone could give me some more reasons why it's better? I am looking to find out more information about SMTP benefits.
I have looked at both documentation looked at the features they both offer, searched google for PHPMailer vs SwiftMailer but not found anything saying why one is better than the other.
Does anyone have experience with any of them?
Does one have more benefits than the other?
Would you say one is better than the other?
I did read a lot of people saying PHPMailer was a dead project but those posts was relatively old. Looking at PHPMailer's website it seems the project is and has been back in development for some time now.
Thanks for anything you can provide on either PHPMailer and/or SwiftMailer. Hopefully I can decide on one or the other as at the moment I have no reason on why I would choose one over the other.
I say absolutely Swiftmailer.
It is written in PHP 5 and component-based; PHPMailer is PHP 4
It has a cleaner web site with better examples
It has better documentation
It has only one version flying around the Internet and not at least two, like PHPMailer has.
I've used PHPMailer for my projects and have no complaints about it. Haven't used Swiftmailer, but both seem to be pretty much the same in terms of usage and usefulness, differing only in implementation details. When you get right down to it, they're both just friendly interfaces to hide the details of SMTP email from you.
Pick whichever one whose style suits you best and go with it.
The only time I had to stray from the mail built-in function was when I needed to send an email from authentic "Gmail" account (client was receiving mail from our app in his spam folder).
In this case I used PEAR's Mail Extension which was really easy to use:
http://pear.php.net/package/Mail
I'm looking for a way to allow a user to upload a large file (~1gb) to my unix server using a web page and browser.
There are a lot of examples that illustrate how to do this with a traditional post request, however this doesn't seem like a good idea when the file is this large.
I'm looking for recommendations on the best approach.
Bonus points if the method includes a way of providing progress information to the user.
For now security is not a major concern, as most users who will be using the service can be trusted. We can also assume that the connection between client and host will not be interrupted (or if it is they have to start over).
We can also assume the user is running a browser of supporting most modern features (JavaScript, Flash, etc)
edit
No language requirements. Just looking for the best solution.
There are several ways to handle this,
1. Flash Uploader
Theres plenty of flash uploaders to improve the users GUI so that they can examine the process and the process factors such as time left, KB Done etc.
This is very good if you understand how to improve Flash source code for later developments.
2. Ajax
Theres a few ways using Ajax and PHP (although PHP Does not support it) you can use Perl module to accomplish the same thing http://pecl.php.net/package/uploadprogress, This is only if you wish to show percentage information etc.
3 Basic Javascript.
This method would be just the regular form, but with some ajax styling so when the form is submitted you can show a basic loader saying please wait while you send us the file...
If your using asp, you can take a look at: http://neatupload.codeplex.com/
Hope theres some good information to get you on your way.
Regards
Not sure about your language requirements, but you can look e.g. into
http://pypi.python.org/pypi/gp.fileupload/
Supports progress information also, btw.
I have used the dojo FileUploader widget to reliably upload audio files greater than a gigabyte with a progress bar. Though you said security was not an issue, I'd like to say that I got HTTPS uploads w/cookie based authentication hooked up flawlessly.
See: http://www.sitepen.com/blog/2008/09/02/the-dojo-toolkit-multi-file-uploader/ and
http://api.dojotoolkit.org/jsdoc/1.3/dojox.form.FileUploader