简体   繁体   English

如何从php / jsp / ruby​​ / perl将信息发送到电子邮件

[英]how to send information to an email from php/jsp/ruby/perl

In php/jsp/ruby or perl...how hard is it to send information to an email? 在php / jsp / ruby​​或perl中...将信息发送到电子邮件有多困难? 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. 我正在计划让用户从html表单中放入信息,将信息发送回服务器,服务器将其放入数据库,然后我们向用户发送电子邮件。 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? 就像我需要自己的smtp服务器吗? Can I simply send emails using my gmail? 我可以简单地使用gmail发送电子邮件吗?

in php it's easy indeed: 在PHP中,确实很容易:

<?php
if($_POST['submit']) {
$title = ''
$message = ''
$to = 'any@mail.net'
mail($to, $title, $message);
exit()

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). 您唯一的要求是建立与SMTP服务器的连接(可以通过使用流行的公共库来完成)。 and then you can use gmail to send emails if you provide configruration to gmail smtp server with your account password. 然后,如果您使用帐户密码为gmail smtp服务器提供配置,则可以使用gmail发送电子邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM