将数据表发送到电子邮件!! [英] send data form to an e-mail!!

查看:70
本文介绍了将数据表发送到电子邮件!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

i想知道如何将表单数据发送到邮件

表单,用户输入数据,按下提交时将其发送到邮件

thanx。

解决方案

现在的问题是:您是要发送输入的数据还是要发送html到你的用户?请记住,有些用户(比如我自己)不喜欢电子邮件中的html,所以我只想假装你要发送文字。


下一个问题是:你呢?你的php.ini文件中配置了邮件?这是Windows和Unix的不同定义,所以在开始之前你必须知道。


拥有所有这些,你可以简单地使用php创建和发送电子邮件消息的邮件功能(网上有很多邮件类,但我想你想用这个简单的PHP)。

下面的代码将告诉你如何实现这一点。有关mail()函数的更详细说明,请参阅 PHP邮件参考 mail()函数


以下代码显示了一个简单的电子邮件脚本。

[PHP]

<?php

//收件人的电子邮件地址


To =''JohynDoe@hisnet.com'';

//发件人的电子邮件地址


From =''MyId@mynet.com'';

//您留言的主题

hello,
i want to know how to send a form data to a mail
that form ,the user enters its data and when pressing submit it sends that data to a mail
thanx.

解决方案

Question now is: do you want to send just the entered data or do you want to send html to your user? Remember that some users (like myself) don''t like html in their emails, so I''ll just assume that you want to send text.

Next question is: do you have mail configured in your php.ini file? This is a different definition for Windows and Unix, so you''ll have to know that before you start.

Having all that, you can simply create and send an email message using php''s mail function (there are plenty of mailo classes around on the net, but I assume you want to use simple php for this).
The following code will show you how to accomplish this. For a more detailed explanation on the mail() function see the php documentation at PHP mail reference and mail() function

The following code shows a simple email script.
[PHP]
<?php
// email address of the adressee


To = ''JohynDoe@hisnet.com'';
// email address of the sender


From = ''MyId@mynet.com'';
// the subject of your message


这篇关于将数据表发送到电子邮件!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆