How to verify recipient email address using utl_smtp in oracle
I have written a simple code to send emails from Oracle Plsql using utl_smtp. I want to verify the email address of the recipient, if it exists or not. How can I do that. I tried utl_smtp.vrfy but it doesn't seem to work. It always shows can not verify user. It seems this function doesn't work anymore in oracle.
Is there any other way by which we can verify the email of recipient . I am writing the below code and trying to verify email .
declare
l_mail_conn utl_smtp.connection;
l_result utl_smtp.reply;
l_sqlcode varchar2(1000);
begin
l_mail_conn :=utl_smtp.open_connection('smtp.antwerpen.be',25);
utl_smtp.helo(l_mail_conn,'smtp.antwerpen.be');
utl_smtp.mail(l_mail_conn,'abha@antwerpen.be');
utl_smtp.rcpt(l_mail_conn,'abha.g123@antwerpen.be');
l_result := utl_smtp.vrfy(l_mail_conn,'abha.g123@antwerpen.be');
dbms_output.put_line(l_result.code ||' ' || l_result.text);
utl_smtp.quit(l_mail_conn);
exception when others then
dbms_output.put_line(sqlerrm);
end;
/
Please suggest.
oracle
|
show 1 more comment
I have written a simple code to send emails from Oracle Plsql using utl_smtp. I want to verify the email address of the recipient, if it exists or not. How can I do that. I tried utl_smtp.vrfy but it doesn't seem to work. It always shows can not verify user. It seems this function doesn't work anymore in oracle.
Is there any other way by which we can verify the email of recipient . I am writing the below code and trying to verify email .
declare
l_mail_conn utl_smtp.connection;
l_result utl_smtp.reply;
l_sqlcode varchar2(1000);
begin
l_mail_conn :=utl_smtp.open_connection('smtp.antwerpen.be',25);
utl_smtp.helo(l_mail_conn,'smtp.antwerpen.be');
utl_smtp.mail(l_mail_conn,'abha@antwerpen.be');
utl_smtp.rcpt(l_mail_conn,'abha.g123@antwerpen.be');
l_result := utl_smtp.vrfy(l_mail_conn,'abha.g123@antwerpen.be');
dbms_output.put_line(l_result.code ||' ' || l_result.text);
utl_smtp.quit(l_mail_conn);
exception when others then
dbms_output.put_line(sqlerrm);
end;
/
Please suggest.
oracle
I doubt that it's feasible to verify if email exists or not. The only thing that yo can do is to check that email address corresponds to email's RFC format. There are a lot of them, just google. The full regex is quite big though. Also there is a procedure in Alexandria plsql library which provides validation github.com/mortenbra/alexandria-plsql-utils/blob/master/demos/…
– Ilia Maskov
Nov 15 '18 at 12:11
What exactly does it show? It may not be an Oracle issue - are you sure the server doesn't have VRFY disabled; or if it is allowed, that it just can't resolve that address? (I can't reach that server to see what it allows...)
– Alex Poole
Nov 15 '18 at 12:29
An option to verify whether an email address is likely to be valid is to use Mailgun's SMTP validator - I have written an API for it here: github.com/jeffreykemp/mailgun-plsql-api
– Jeffrey Kemp
Nov 16 '18 at 3:00
@AlexPoole : VRFY command results in this message : "252 2.5.2 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ". For all the email addresses whether they exists or not. Can you please let me know, how to be sure if the VRFY is enabled on the server.
– Abha
Nov 16 '18 at 7:50
@JeffreyKemp : I am afraid, I cannot use any simulator for this. I just need to write code in en existing package that sends a mail to recipients. Is there any way to do that ? I want to make sure if the correctly formatted email address exists or not for a particular user...
– Abha
Nov 16 '18 at 7:52
|
show 1 more comment
I have written a simple code to send emails from Oracle Plsql using utl_smtp. I want to verify the email address of the recipient, if it exists or not. How can I do that. I tried utl_smtp.vrfy but it doesn't seem to work. It always shows can not verify user. It seems this function doesn't work anymore in oracle.
Is there any other way by which we can verify the email of recipient . I am writing the below code and trying to verify email .
declare
l_mail_conn utl_smtp.connection;
l_result utl_smtp.reply;
l_sqlcode varchar2(1000);
begin
l_mail_conn :=utl_smtp.open_connection('smtp.antwerpen.be',25);
utl_smtp.helo(l_mail_conn,'smtp.antwerpen.be');
utl_smtp.mail(l_mail_conn,'abha@antwerpen.be');
utl_smtp.rcpt(l_mail_conn,'abha.g123@antwerpen.be');
l_result := utl_smtp.vrfy(l_mail_conn,'abha.g123@antwerpen.be');
dbms_output.put_line(l_result.code ||' ' || l_result.text);
utl_smtp.quit(l_mail_conn);
exception when others then
dbms_output.put_line(sqlerrm);
end;
/
Please suggest.
oracle
I have written a simple code to send emails from Oracle Plsql using utl_smtp. I want to verify the email address of the recipient, if it exists or not. How can I do that. I tried utl_smtp.vrfy but it doesn't seem to work. It always shows can not verify user. It seems this function doesn't work anymore in oracle.
Is there any other way by which we can verify the email of recipient . I am writing the below code and trying to verify email .
declare
l_mail_conn utl_smtp.connection;
l_result utl_smtp.reply;
l_sqlcode varchar2(1000);
begin
l_mail_conn :=utl_smtp.open_connection('smtp.antwerpen.be',25);
utl_smtp.helo(l_mail_conn,'smtp.antwerpen.be');
utl_smtp.mail(l_mail_conn,'abha@antwerpen.be');
utl_smtp.rcpt(l_mail_conn,'abha.g123@antwerpen.be');
l_result := utl_smtp.vrfy(l_mail_conn,'abha.g123@antwerpen.be');
dbms_output.put_line(l_result.code ||' ' || l_result.text);
utl_smtp.quit(l_mail_conn);
exception when others then
dbms_output.put_line(sqlerrm);
end;
/
Please suggest.
oracle
oracle
edited Nov 15 '18 at 12:03
Wernfried Domscheit
24.1k42858
24.1k42858
asked Nov 15 '18 at 11:42
AbhaAbha
588
588
I doubt that it's feasible to verify if email exists or not. The only thing that yo can do is to check that email address corresponds to email's RFC format. There are a lot of them, just google. The full regex is quite big though. Also there is a procedure in Alexandria plsql library which provides validation github.com/mortenbra/alexandria-plsql-utils/blob/master/demos/…
– Ilia Maskov
Nov 15 '18 at 12:11
What exactly does it show? It may not be an Oracle issue - are you sure the server doesn't have VRFY disabled; or if it is allowed, that it just can't resolve that address? (I can't reach that server to see what it allows...)
– Alex Poole
Nov 15 '18 at 12:29
An option to verify whether an email address is likely to be valid is to use Mailgun's SMTP validator - I have written an API for it here: github.com/jeffreykemp/mailgun-plsql-api
– Jeffrey Kemp
Nov 16 '18 at 3:00
@AlexPoole : VRFY command results in this message : "252 2.5.2 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ". For all the email addresses whether they exists or not. Can you please let me know, how to be sure if the VRFY is enabled on the server.
– Abha
Nov 16 '18 at 7:50
@JeffreyKemp : I am afraid, I cannot use any simulator for this. I just need to write code in en existing package that sends a mail to recipients. Is there any way to do that ? I want to make sure if the correctly formatted email address exists or not for a particular user...
– Abha
Nov 16 '18 at 7:52
|
show 1 more comment
I doubt that it's feasible to verify if email exists or not. The only thing that yo can do is to check that email address corresponds to email's RFC format. There are a lot of them, just google. The full regex is quite big though. Also there is a procedure in Alexandria plsql library which provides validation github.com/mortenbra/alexandria-plsql-utils/blob/master/demos/…
– Ilia Maskov
Nov 15 '18 at 12:11
What exactly does it show? It may not be an Oracle issue - are you sure the server doesn't have VRFY disabled; or if it is allowed, that it just can't resolve that address? (I can't reach that server to see what it allows...)
– Alex Poole
Nov 15 '18 at 12:29
An option to verify whether an email address is likely to be valid is to use Mailgun's SMTP validator - I have written an API for it here: github.com/jeffreykemp/mailgun-plsql-api
– Jeffrey Kemp
Nov 16 '18 at 3:00
@AlexPoole : VRFY command results in this message : "252 2.5.2 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ". For all the email addresses whether they exists or not. Can you please let me know, how to be sure if the VRFY is enabled on the server.
– Abha
Nov 16 '18 at 7:50
@JeffreyKemp : I am afraid, I cannot use any simulator for this. I just need to write code in en existing package that sends a mail to recipients. Is there any way to do that ? I want to make sure if the correctly formatted email address exists or not for a particular user...
– Abha
Nov 16 '18 at 7:52
I doubt that it's feasible to verify if email exists or not. The only thing that yo can do is to check that email address corresponds to email's RFC format. There are a lot of them, just google. The full regex is quite big though. Also there is a procedure in Alexandria plsql library which provides validation github.com/mortenbra/alexandria-plsql-utils/blob/master/demos/…
– Ilia Maskov
Nov 15 '18 at 12:11
I doubt that it's feasible to verify if email exists or not. The only thing that yo can do is to check that email address corresponds to email's RFC format. There are a lot of them, just google. The full regex is quite big though. Also there is a procedure in Alexandria plsql library which provides validation github.com/mortenbra/alexandria-plsql-utils/blob/master/demos/…
– Ilia Maskov
Nov 15 '18 at 12:11
What exactly does it show? It may not be an Oracle issue - are you sure the server doesn't have VRFY disabled; or if it is allowed, that it just can't resolve that address? (I can't reach that server to see what it allows...)
– Alex Poole
Nov 15 '18 at 12:29
What exactly does it show? It may not be an Oracle issue - are you sure the server doesn't have VRFY disabled; or if it is allowed, that it just can't resolve that address? (I can't reach that server to see what it allows...)
– Alex Poole
Nov 15 '18 at 12:29
An option to verify whether an email address is likely to be valid is to use Mailgun's SMTP validator - I have written an API for it here: github.com/jeffreykemp/mailgun-plsql-api
– Jeffrey Kemp
Nov 16 '18 at 3:00
An option to verify whether an email address is likely to be valid is to use Mailgun's SMTP validator - I have written an API for it here: github.com/jeffreykemp/mailgun-plsql-api
– Jeffrey Kemp
Nov 16 '18 at 3:00
@AlexPoole : VRFY command results in this message : "252 2.5.2 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ". For all the email addresses whether they exists or not. Can you please let me know, how to be sure if the VRFY is enabled on the server.
– Abha
Nov 16 '18 at 7:50
@AlexPoole : VRFY command results in this message : "252 2.5.2 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ". For all the email addresses whether they exists or not. Can you please let me know, how to be sure if the VRFY is enabled on the server.
– Abha
Nov 16 '18 at 7:50
@JeffreyKemp : I am afraid, I cannot use any simulator for this. I just need to write code in en existing package that sends a mail to recipients. Is there any way to do that ? I want to make sure if the correctly formatted email address exists or not for a particular user...
– Abha
Nov 16 '18 at 7:52
@JeffreyKemp : I am afraid, I cannot use any simulator for this. I just need to write code in en existing package that sends a mail to recipients. Is there any way to do that ? I want to make sure if the correctly formatted email address exists or not for a particular user...
– Abha
Nov 16 '18 at 7:52
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53318723%2fhow-to-verify-recipient-email-address-using-utl-smtp-in-oracle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53318723%2fhow-to-verify-recipient-email-address-using-utl-smtp-in-oracle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I doubt that it's feasible to verify if email exists or not. The only thing that yo can do is to check that email address corresponds to email's RFC format. There are a lot of them, just google. The full regex is quite big though. Also there is a procedure in Alexandria plsql library which provides validation github.com/mortenbra/alexandria-plsql-utils/blob/master/demos/…
– Ilia Maskov
Nov 15 '18 at 12:11
What exactly does it show? It may not be an Oracle issue - are you sure the server doesn't have VRFY disabled; or if it is allowed, that it just can't resolve that address? (I can't reach that server to see what it allows...)
– Alex Poole
Nov 15 '18 at 12:29
An option to verify whether an email address is likely to be valid is to use Mailgun's SMTP validator - I have written an API for it here: github.com/jeffreykemp/mailgun-plsql-api
– Jeffrey Kemp
Nov 16 '18 at 3:00
@AlexPoole : VRFY command results in this message : "252 2.5.2 Cannot VRFY user; try RCPT to attempt delivery (or try finger) ". For all the email addresses whether they exists or not. Can you please let me know, how to be sure if the VRFY is enabled on the server.
– Abha
Nov 16 '18 at 7:50
@JeffreyKemp : I am afraid, I cannot use any simulator for this. I just need to write code in en existing package that sends a mail to recipients. Is there any way to do that ? I want to make sure if the correctly formatted email address exists or not for a particular user...
– Abha
Nov 16 '18 at 7:52