i am currently trying to configure a email sending function using an SMTP server.
when i send a mail to and from a person with the email extension of @dtss.com (The company employes) it works perfectly with attachments and everything
if i change the ToAddress to anything else (i.e. matthew@crimzone.com) it gives me this error: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for matthew@crimzone.com
ive search forums and turned relaying on, allow anonymous on authentification and enabled logging... it still doesnt work
this is the code:
the message details are determined in another method and that works fine. Username and password is null.
public static void SendMailQ(MailMessage Message)
{
SmtpClient cli = new SmtpClient("172.16.252.8");
bool useAuth = false;
string userName = string.Empty;
string password = string.Empty;
string authDomain = string.Empty;
NetworkCredential cred = null;
cli.UseDefaultCredentials = false;
cli.UseDefaultCredentials = false;
if (string.IsNullOrEmpty(authDomain))
{
cred = new NetworkCredential(userName, password);
}
else
{
cred = new NetworkCredential(userName, password, authDomain);
}
cli.Credentials = cred;
cli.Send(Message); //////bombs out here
can anybody help? have i missed out something?