发送mysql查询结果作为邮件附件PHP [英] Send mysql query result as mail attachment PHP

查看:87
本文介绍了发送mysql查询结果作为邮件附件PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Debuggers,



我正在努力通过php发送mysql结果作为电子邮件附件。



我在谷歌尝试并尝试了一些步骤。但没有任何东西对我有效。



即使我使用了类似class.email-query-results-as-csv-file.php这样的类。什么都没有奏效。

有没有人可以帮到我?



先谢谢,

Elancheran



我尝试过:



setQuery(SELECT * FROM cam_ad_booking);

$ emailCSV-> sendEmail(elanworlds@gmail.com,elanworlds @gmail,MySQL查询结果为CSV附件);

?>

Hi Debuggers,

Am struggling in a point to send mysql result as Email attachment through php.

I have tried in google and tried some steps. But nothing was worked for me.

Even i have used some class like class.email-query-results-as-csv-file.php. Nothing was working.
Does any have can help on me?

Thanks in Advance,
Elancheran

What I have tried:

setQuery("SELECT * FROM cam_ad_booking");
$emailCSV->sendEmail("elanworlds@gmail.com","elanworlds@gmail","MySQL Query Results as CSV Attachment");
?>

推荐答案

emailCSV-> sendEmail(elanworlds@gmail.com,elanworlds @ gmail,MySQL查询结果为CSV附件);

?>
emailCSV->sendEmail("elanworlds@gmail.com","elanworlds@gmail","MySQL Query Results as CSV Attachment");
?>


根据您的评论,您的问题与CSV文件创建/ mysql无关。您的问题是您不知道如何发送带有PHP附件的电子邮件。



鉴于您没有发布函数emailcsv-> sendEmail您可能需要添加另一个参数以接受文件位置,或者您决定处理它。这里的任何一种方法都是用PHP发送带附件的电子邮件的研究:



在电子邮件中发送附件 - Google搜索 [ ^ ]



使用PHP Mail发送附件()? - 堆栈溢出 [ ^ ]



PHP:发送电子邮件(文本/ HTML /附件) [ ^ ]



PHP邮件附件脚本和功能| Tutdepot.com [ ^ ]



您已声明可以创建csv并将其保存到本地,这意味着您拥有该文件位置的完整路径。你还说你可以用谷歌发送电子邮件......很棒。现在您需要做的就是使用上面的链接,一点脑力,然后您就可以通过php发送电子邮件发送您的csv文件(附件)。
based on your comment, your issue has nothing to do with CSV file creation/mysql. Your issue is you don't know how to send an email with an attachment in PHP.

Given you did not post the function emailcsv->sendEmail you probably need to add another parameter to accept a file location or however you decide to handle it. Either way here is the research for sending emails in PHP with attachments:

Send attachments in email php - Google Search[^]

Send attachments with PHP Mail()? - Stack Overflow[^]

PHP: Sending Email (Text/HTML/Attachments)[^]

PHP mail attachment script and function | Tutdepot.com[^]

You've stated you can create the csv and save it to local, that means you have the full path to that files location. You also said you can send an email using google...great. Now all you need to do is use the above links, a little brain power, and then you'll be able to send your csv file (an attachment) via email in php.


这篇关于发送mysql查询结果作为邮件附件PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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