I am trying to send a mail from [email protected] to [email protected] by doing this:
MailMessage mailObj = new MailMessage();
mailObj.From = new MailAddress("[email protected]");
mailObj.To.Add("[email protected]");
mailObj.Body = "HEJ";
mailObj.Subject = "HEJ";
SmtpClient SMTPServer = new SmtpClient();
SMTPServer.Send(mailObj);
In my web.config, i have this:
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="mail.bitcoindk.dk" port="25" userName="[email protected]" password="password" />
</smtp>
</mailSettings>
</system.net>
When i send the mail, i get this exception
Transaction failed. The server response was: 5.7.1 <[email protected]>: Relay access denied
If i send a mail to [email protected], it works fine. But if i send to [email protected], or any other mail, i get the exception. I am using Uno Euro's mail service.