Email Sender not sending to gmail,hotmail etc but will send to the domain from it is sent addresses
-
Hi all, I am modifying an application that will send email via smtp.My problem is its not sending emails to gmail,aol etc.Getting an eror"Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email]" I searched and found its issue with authetication. My questions are: 1)Is it possible to sent mail to gmail,hotmail,aol etc from a application like this. 2)Whats the username and pasword for authntication .I found this code when i searched but confused about how to implement.Any help is welcome. The link is " My code looks like this: public void sendSmtp() { if (!ValidateEmailSender()) return; clsEmailSender emailSender = new clsEmailSender(); MailAddress sendFrom = new MailAddress("devjn@itsoft.com"); MailAddress sendTo = new MailAddress(txtEmailTo.Text); MailMessage myMessage = new MailMessage(sendFrom, sendTo); if(txtEmailCc.Text!="") { MailAddress sendCc = new MailAddress(txtEmailCc.Text); myMessage.CC.Add(sendCc); } if (txtEmailBcc.Text != "") { MailAddress sendBcc = new MailAddress(txtEmailBcc.Text); myMessage.Bcc.Add(sendBcc); } myMessage.Subject = txtEmailSubject.Text; myMessage.Body = txtEmailBody.Text; SmtpClient emailClient = new SmtpClient("mail.tri.com", 28); emailClient.Send(myMessage); }
-
Hi all, I am modifying an application that will send email via smtp.My problem is its not sending emails to gmail,aol etc.Getting an eror"Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email]" I searched and found its issue with authetication. My questions are: 1)Is it possible to sent mail to gmail,hotmail,aol etc from a application like this. 2)Whats the username and pasword for authntication .I found this code when i searched but confused about how to implement.Any help is welcome. The link is " My code looks like this: public void sendSmtp() { if (!ValidateEmailSender()) return; clsEmailSender emailSender = new clsEmailSender(); MailAddress sendFrom = new MailAddress("devjn@itsoft.com"); MailAddress sendTo = new MailAddress(txtEmailTo.Text); MailMessage myMessage = new MailMessage(sendFrom, sendTo); if(txtEmailCc.Text!="") { MailAddress sendCc = new MailAddress(txtEmailCc.Text); myMessage.CC.Add(sendCc); } if (txtEmailBcc.Text != "") { MailAddress sendBcc = new MailAddress(txtEmailBcc.Text); myMessage.Bcc.Add(sendBcc); } myMessage.Subject = txtEmailSubject.Text; myMessage.Body = txtEmailBody.Text; SmtpClient emailClient = new SmtpClient("mail.tri.com", 28); emailClient.Send(myMessage); }
-
Hi all, I am modifying an application that will send email via smtp.My problem is its not sending emails to gmail,aol etc.Getting an eror"Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email]" I searched and found its issue with authetication. My questions are: 1)Is it possible to sent mail to gmail,hotmail,aol etc from a application like this. 2)Whats the username and pasword for authntication .I found this code when i searched but confused about how to implement.Any help is welcome. The link is " My code looks like this: public void sendSmtp() { if (!ValidateEmailSender()) return; clsEmailSender emailSender = new clsEmailSender(); MailAddress sendFrom = new MailAddress("devjn@itsoft.com"); MailAddress sendTo = new MailAddress(txtEmailTo.Text); MailMessage myMessage = new MailMessage(sendFrom, sendTo); if(txtEmailCc.Text!="") { MailAddress sendCc = new MailAddress(txtEmailCc.Text); myMessage.CC.Add(sendCc); } if (txtEmailBcc.Text != "") { MailAddress sendBcc = new MailAddress(txtEmailBcc.Text); myMessage.Bcc.Add(sendBcc); } myMessage.Subject = txtEmailSubject.Text; myMessage.Body = txtEmailBody.Text; SmtpClient emailClient = new SmtpClient("mail.tri.com", 28); emailClient.Send(myMessage); }
That's because your SMTP server doesn't allow mail relay. The from address has to be an account on the SMTP server, or it won't send.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001