truemail-java-client
- Web API Java client for Truemail Server.
Actual and maintainable documentation 📚 for developers is living here.
- Requirements
- Installation
- Usage
- Truemail family
- Contributing
- License
- Code of Conduct
- Credits
- Versioning
- Changelog
- Developers Documentation
Java 1.8+
Please change {version} to needed version, for example 0.1.0. All available versions you can find here.
<dependency>
<groupId>org.truemail-rb</groupId>
<artifactId>truemail-java-client</artifactId>
<version>{version}</version>
</dependency>
implementation 'org.truemail-rb:truemail-java-client:{version}'
<dependency org="org.truemail-rb" name="truemail-java-client" rev="{version}" />
@Grapes(
@Grab(group='org.truemail-rb', module='truemail-java-client', version='{version}')
)
import org.truemail_rb.TruemailClient;
import org.truemail_rb.client.TruemailConfiguration;
To have an access for TruemailClient#validate
you must create configuration instance first as in the example below:
// Required parameter. It should be true or false
boolean secureConnection = true;
// Required parameter. It should be a hostname or an ip address where Truemail server runs
String host = "example.com";
// Optional parameter. By default it is equal 9292
int port = 80;
// Required parameter. It should be valid Truemail server access token
String token = "token";
TruemailConfiguration truemailConfiguration = new TruemailConfiguration(secureConnection, host, token, port);
// or without port, will be used 9292 port by default
// TruemailConfiguration truemailConfiguration = new TruemailConfiguration(secureConnection, host, token);
After successful configuration, you can establish connection with Truemail server.
TruemailClient truemailClient = new TruemailClient(truemailConfiguration);
truemailClient.validate("admin@bestweb.com.ua")
=>
{
"date": "2020-10-26 10:42:42 +0200",
"email": "admin@bestweb.com.ua",
"validation_type": "smtp",
"success": true,
"errors": null,
"smtp_debug": null,
"configuration": {
"validation_type_by_domain": null,
"whitelist_validation": false,
"whitelisted_domains": null,
"blacklisted_domains": null,
"smtp_safe_check": false,
"email_pattern": "default gem value",
"smtp_error_body_pattern": "default gem value"
}
}
TruemailClient#validate
always returns JSON data. If something goes wrong you will receive JSON with error details:
{
"truemail_client_error": "error details"
}
All Truemail solutions: https://truemail-rb.org
Name | Type | Description |
---|---|---|
truemail | ruby gem | Configurable plain Ruby email validator, main core |
truemail-go | go package | Configurable Golang email validator, main core |
truemail server | ruby app | Lightweight rack based web API wrapper for Truemail |
truemail-rack-docker | docker image | Lightweight rack based web API dockerized image 🐳 of Truemail server |
truemail-ruby-client | ruby gem | Web API Ruby client for Truemail Server |
truemail-crystal-client | crystal shard | Web API Crystal client for Truemail Server |
truemail-rspec | ruby gem | Truemail configuration, auditor and validator RSpec helpers |
Bug reports and pull requests are welcome on GitHub at https://github.com/truemail-rb/truemail-java-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct. Please check the open tikets. Be shure to follow Contributor Code of Conduct below and our Contributing Guidelines.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the truemail-java-client
project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
- The Contributors for code and awesome suggestions
- The Stargazers for showing their support
truemail-java-client
uses Semantic Versioning 2.0.0