UTL_SMTP 包的问题(从 ORACLE 发送电子邮件)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3805447/
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
Problem with UTL_SMTP package (sending emails from ORACLE)
提问by Tolga E
Everything's been working fine and haven't made any changes to our mail packages. But i just noticed that our unsent_emails table has been filling up, and when i tried to manually sent the unsent emails (a periodic job set up in user_jobs) i get the following errors;
一切正常,我们的邮件包没有做任何更改。但我刚刚注意到我们的 unsent_emails 表已满,当我尝试手动发送未发送的电子邮件(在 user_jobs 中设置的定期作业)时,出现以下错误;
Error with main mail package: ORA-29279: SMTP permanent error: 501 5.5.2 MAIL FROM syntax error ORA-06512: at "SYS.UTL_SMTP", line 20
ORA-06512: at "SYS.UTL_SMTP", line 98
ORA-06512: at "SYS.UTL_SMTP", line 221
ORA-06512: at "TRS.MAILPKG", line 63
主邮件包错误:ORA-29279:SMTP 永久错误:501 5.5.2 MAIL FROM 语法错误 ORA-06512:在“SYS.UTL_SMTP”,第 20 行
ORA-06512:在“SYS.UTL_SMTP”,第 98 行
ORA- 06512:在“SYS.UTL_SMTP”,第 221 行
ORA-06512:在“TRS.MAILPKG”,第 63 行
Any idea why this might be happening?
知道为什么会发生这种情况吗?
采纳答案by Tolga E
the problem was because of my "from" email (looked into it thanks to Bob Jarvis).. it didn't look like an email address (which have worked before but i think there were some changes to the email server which makes it not work now)
问题是由于我的“发件人”电子邮件(感谢 Bob Jarvis 对其进行了调查)。在工作,在忙)
回答by bhangm
Are all the unsent emails going out to multiple recipients ?
是否所有未发送的电子邮件都发送给多个收件人?
Here's a link to orafaq that suggests that it might have something to do with sending emails to multiple recipients and using the semicolon - ';' instead of the comma - ',' delimiter.
这是 orafaq 的链接,它表明它可能与向多个收件人发送电子邮件并使用分号有关 - ';' 而不是逗号 - ',' 分隔符。
http://www.orafaq.com/forum/t/119863/2/
http://www.orafaq.com/forum/t/119863/2/
If this is the case, then try using a comma as a delimiter for multiple recipients
如果是这种情况,请尝试使用逗号作为多个收件人的分隔符
回答by Lorinczy Zsigmond
Got the same problem with package 'utl_mail': it sends 'MAIL FROM:[email protected]' but it should be 'MAIL FROM:<[email protected]>'
包“ utl_mail”有同样的问题:它发送“ MAIL FROM:[email protected]”但它应该是“ MAIL FROM:<[email protected]>”
Whatever I specify as sender, it doesn't change this; on the other hand, RCPT TO is always correctly angle-bracketed, whatever I specify.
无论我指定为发件人,它都不会改变这一点;另一方面,无论我指定什么,RCPT TO 总是正确地用尖括号括起来。
With 'utl_smtp' it is enough to add angle brackets around the parameters of UTL_SMTP.MAIL and UTL_SMTP.RCPT.
使用“ utl_smtp”,在 UTL_SMTP.MAIL 和 UTL_SMTP.RCPT 的参数周围添加尖括号就足够了。
Oracle does have examples which might help implementing utl_mail.send-like functions with utl_stml, so I'd suggest using that.
Oracle 确实有一些示例可能有助于使用 utl_stml 实现类似 utl_mail.send 的功能,所以我建议使用它。