简体   繁体   English

使用 MailGun API 验证电子邮件地址

[英]Validate Email Address with MailGun API

I'm able to use the mailgun api to send email, but when I try to validate an email address then I get a 403 error (which comes through as An HTTP Error has occurred! Check your network connection and try again. which is a bad error message).我可以使用 mailgun api 发送电子邮件,但是当我尝试验证电子邮件地址时,我收到 403 错误( An HTTP Error has occurred! Check your network connection and try again.并重An HTTP Error has occurred! Check your network connection and try again.这是一个错误的错误信息)。

I've tried using both the public and private api keys along with the public and private email validation endpoints.我尝试使用公共和私人 api 密钥以及公共和私人电子邮件验证端点。 Neither work, both give me a 403.都不行,都给我 403。

$mg = Mailgun::create($private_apikey);
$validation = $mg->get('address/private/validate', array('address' => $email));

$mg = Mailgun::create($public_apikey);
$validation = $mg->get('address/validate', array('address' => $email));

What is wrong?怎么了?

to prevent abuse, we require a credit card on the account to make use of the email validations feature.为防止滥用,我们要求帐户上有信用卡才能使用电子邮件验证功能。 You will not be charged - all free accounts include 10,000 messages and 100 email validations.不会向您收费 - 所有免费帐户都包含 10,000 条消息和 100 封电子邮件验证。

Once you apply a credit card to your account you should be all set!一旦您将信用卡申请到您的帐户,您应该一切准备就绪!

Mike ||迈克|| Mailgun Sales Engineer Mailgun 销售工程师

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM