views:

15

answers:

2

In php/jsp/ruby or perl...how hard is it to send information to an email? I am planning to have something where user puts in the information from an html form, information gets sent back to the server, server puts it in DB, then we send an email to the user. This is very basic functianality that I've seen many sites do.

Can someone please point me to some examples of how to send emails and what the requirements are for that. like do I need my own smtp server? Can I simply send emails using my gmail?

A: 

This is pretty easy in most of languages. Whatever your choice will be you can afford this easily I think. Your only requirement is to establish connection to a SMTP server (which can be done by using popular public libraries). and then you can use gmail to send emails if you provide configruration to gmail smtp server with your account password.

Lukasz Dziedzia
A: 

You can use your gmail but dont forget, gmail has limits and verifications (for example amount of emails being sent by hour), also it uses SSL in the connections so the normal codes you see around for mailing people from within your server won't suit you, you gona need a socket or imap code in order to succefull connect to gmail or maybe even using their api not sure if you can do that from normal accounts but you should check about it, might be easier then the 2 options above.

You can see some php samples here: http://php.net/manual/en/function.mail.php

Some perl sample here: http://www.perlfect.com/articles/sendmail.shtml

I am not aware of any samples connecting to gmail so i am sorry on that one...

EDIT about the smtp server: If you are not able to use gmail then yes, you will need a stmp server (but if you have a hosting plan anywhere you might have access to it, so dont worry), if you make your own depending on how your connection is, it won't be a good approch because of how most system classify emails specially comming from a dynamic ip for example.

Prix