vibe.d beta banner
get vibe.d
0.8.1

Asynchronous I/O that doesn’t get in your way, written in D

Function validateEmail

Provides a simple email address validation.

string validateEmail (
  string str,
  size_t max_length = 64
);

bool validateEmail(R) (
  ref R error_sink,
  string str,
  size_t max_length = 64
)
if (isOutputRange!(R, char));

Note that the validation could be stricter in some cases than required. The user name is forced to be ASCII, which is not strictly required as of RFC 6531. It also does not allow quotiations for the user name part (RFC 5321).

Invalid email adresses will cause an exception with the error description to be thrown.

Authors

Sönke Ludwig

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.