oracle 如何通过 pl/sql 发送电子邮件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4244117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how send email by Pl/sql
提问by Amir
I want send email by using *oracle 9i - Enterprise edition release 9.2.0.8.0 ,*I know there is one package for oracle 10,but would you advice me about it for oracle 9i? Is there any package ?
我想使用*oracle 9i - Enterprise edition release 9.2.0.8.0发送电子邮件,*我知道有一个适用于 oracle 10 的软件包,但是您能建议我为 oracle 9i 使用它吗?有包吗?
Can I sent email by Oracle 9i?Is there any way using an interface program such as a java program and send email via that one, if it is impossible to send mail by Oracle 9i...
我可以通过Oracle 9i发送电子邮件吗?如果无法通过Oracle 9i发送邮件,有没有办法使用接口程序(例如java程序)并通过该程序发送电子邮件...
I mean I just send parameter to that program and send email by using that program. I can run write batch file,can we run Outlook and send email via that one by Oracle 9i?
我的意思是我只是将参数发送到该程序并使用该程序发送电子邮件。我可以运行写入批处理文件,我们可以运行 Outlook 并通过 Oracle 9i 发送电子邮件吗?
P.s. my database is base on 9i and my form builder is version 6.
Ps 我的数据库基于 9i,我的表单生成器是版本 6。
回答by Vincent Malgrat
check this thread on asktom about sending emails (from version 8i+): "Sending e-mail! -- Oracle 8i specific response"
在 asktom 上查看有关发送电子邮件的线程(从 8i+ 版本开始):“发送电子邮件!-- Oracle 8i 特定响应”
In version 9i, you have several options:
在版本 9i 中,您有多种选择:
- using PL/SQL and the UTL_SMTPpackage
- using a java procedure
- 使用 PL/SQL 和UTL_SMTP包
- 使用java程序
The UTL_SMTP option would be the easiest to setup but some features (such as attaching files) may require a bit more work and some knowledge of SMTP. See MikeyByCrikey's answer for a good example.
UTL_SMTP 选项最容易设置,但某些功能(例如附加文件)可能需要更多的工作和一些 SMTP 知识。请参阅MikeyByCrikey的答案以获得一个很好的例子。
If you plan to upgrade, APEX has some mail utility (APEX_MAIL) available for version 10g+.
如果您计划升级,APEX 有一些邮件实用程序 ( APEX_MAIL) 可用于 10g+ 版本。
回答by Mike Meyers
Oracle provides the UTL_SMTPpackage which allows you to send mail. It requires access to a mail server of some description.
Oracle 提供了UTL_SMTP包,它允许您发送邮件。它需要访问某种描述的邮件服务器。
This package is a little complicated to use. There is a supplied demo packagethat is available on the Oracle website which I am using successfully to send mail.
回答by Modafuka
Check this page from Burleson.
从 Burleson 查看此页面。
http://www.dba-oracle.com/t_email_mailing_messages_plsql.htm
http://www.dba-oracle.com/t_email_mailing_messages_plsql.htm
Oracle has, since 8i, the system package utl_smtp for this, and since 10g, the utl_mail that expands this functionality.
从 8i 开始,Oracle 就为此提供了系统包 utl_smtp,从 10g 开始,提供了扩展此功能的 utl_mail。