问题描述
如何将 Oracle PL/SQL 包中的电子邮件发送给多个收件人?我在 oracle 包中有以下 pl/sql 程序,它仅适用于一个接收器.我需要改进它的功能,让它可以同时向多个接收者发送电子邮件,比如To: David Festool; Peter Makita; John Dewalt".任何机构可以帮助我将不胜感激!请提供修改后的代码.
<小时>需要多次调用utl_smtp.rcpt
,每个收件人调用一次;您无法在一次调用中提供值列表.
来自 UTL_SMTP.RCPT 文档:><块引用>
要向多个收件人发送消息,请多次调用此例程次.每次调用都会安排发送到一个电子邮件地址.
这意味着您不能真正传递名称字符串,除非您乐于解析单个地址;可能会更容易传递一组值.
TO
标头是一个单独的问题;如果我没记错的话,那真的只是为了显示,并且在 TO
(或 CC
) 标头是 BCC 的实现方式.虽然需要引用...
这是一个旧的 AskTom证明这一点的文章.不过,应调查 jonearles 建议使用 UTL_MAIL.
How to sent email in Oracle PL/SQL package to multiple receivers? I have below pl/sql procedure within an oracle package, it works only for one receiver. I need to improve it functional to let it can send email to multiple receivers at same time like "To: David Festool; Peter Makita; John Dewalt". Any body can help me out will be great appreciate! Please provide me modified code.
You need to call utl_smtp.rcpt
multiple times, once for each recipient; you can't give a list of values in one call.
From the UTL_SMTP.RCPT documentation:
To send a message to multiple recipients, call this routine multiple times. Each invocation schedules delivery to a single e-mail address.
That means you can't really pass a string of names, unless you're happy to parse the individual addresses out; it would be easier to pass an array of values, probably.
The TO
header is a separate issue; if I recall correctly, that is really just for display, and having an address as a rcpt
but not in the TO
(or CC
) header is how BCC is implemented. Citation needed though...
Here's an old AskTom article demonstrating this. jonearles suggestion to use UTL_MAIL should be investigated though.
这篇关于如何将 Oracle PL/SQL 包中的电子邮件发送给多个收件人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!