First of all, please do not write your configuration settings like that. Instead use the built-in settings placeholders for them.
<system.net>
<mailsettings>
<smtp from="Sender's display name <sender_email@domain.com>">
<network host="mailserver.yourdomain.com" port="25" username="smtp_server_username" password="secret" defaultcredentials="false" />
</smtp>
</mailsettings>
</system.net>
Credit to this SO thread[^].
Secondly the exception is incomplete, Failure sending mail. The actual exception comes later,
1. Remove name could not be resolved.
2. Unable to connect to remote server.
In real, they are all because of the only thing,
connection was not established. Due to many factors. You should consider debugging the application, and see what is wrong. You must also consider giving a look at the exception message. It will let you know what you need to do to resolve the problem. Username/password problems comes later this stage, once the connection has been established. The exception in that case is "
SMTP server requires a secure connection...". In your case, that is not yet the problem. :-)
You may be interested in reading this article of mine,
Sending emails over .NET framework, and general problems – using C# code[
^].