Click here to Skip to main content
15,904,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please provide solution.. the code working fine on local system but when deployed on rediff server it throwing above exception message.

my c# code is:

public void sendEmail(string emailId, string emailBody)
{
try
{
MailMessage mailtocand;
mailtocand = new MailMessage();
mailtocand.From = new MailAddress("MyEmail");
mailtocand.To.Add(new MailAddress(emailId));
mailtocand.Subject = "Subject";
mailtocand.IsBodyHtml = true;

mailtocand.Body = emailBody;
SmtpClient smtpmailclient = new SmtpClient();
smtpmailclient.Host = "smtp.rediffmailpro.com";
smtpmailclient.Port = 25;
smtpmailclient.Timeout = 10000;
smtpmailclient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpmailclient.UseDefaultCredentials = false;
smtpmailclient.Credentials = new NetworkCredential("MyEmail", "Password");

smtpmailclient.Send(mailtocand);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}

}
Posted

Hi sachin,

Your SMTP server will not let you send mail to the target address.

You'll need to speak with whomever manages the smtp server or use a different one.

Make sure you have specified the correct user name and password in Host .

Please check the following link:

http://www.systemnetmail.com/

http://forums.asp.net/t/988184.aspx/1?+quot+Mailbox+name+not+allowed+The+server+response+was+sorry+your+mail+was+administratively+denied+5+7+1+quot+


Thanks,
-RG
 
Share this answer
 
Comments
Sachin Vshishth 6-Mar-14 7:00am    
Thanks RG, i tried all these options but still getting the same problem.
Ramug10 6-Mar-14 7:11am    
The problem may be because of any of the below listed scenarios

1. Your SMTP server is not configured correctly to the PORT 25, open command prompt and enter this telnet smtp.rediffmailpro.com 25 and hit enter, if you see a message something like this "220 mailserver.domain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at Sat, 22 May 2006 08:34:14 +0200", then there isnt any problem in your SMTP configuration if not try to configure it correctly.

2. Assuming that your SMTP is correctly configured then check if the provided network credentials is a valid Entry in your mail system.
Hi,

Did you try adding the following line to your code? Because some of the Public SMTP services [Like Gmail] are allowed only SSL connections.

smtpmailclient .EnableSsl = true;

And also please confirm whether the rediff Mail Service is accessible on the default SMTP port i.e. 25?

Gmail Uses 587 as the SMTP Port number for SMTP client connections.

If these suggestions fix your issue; please mark it as fixed.

Regards,
Subhash konduru
 
Share this answer
 
Comments
Sachin Vshishth 6-Mar-14 7:03am    
Thanks Subhash konduru, I found this port number from rediffmailpro settings>Outgoing server port: 25, also tried with both EnableSsl=true and false.
Hi,

Also try the SMTP Server Name as "smtp.rediffmail.com".

You Should Try the Inbound Port Number as you are trying to send the email through the Application to the Reddiff Mail Server. Please let me know if you find any solution to this problem. If the issue is resolved; Mark it is answered.

Regards,
Subhash Konduru
Quote:
do get messages first to authenticate yourself.(#4.4.3)
Looks like that server is configured to require POP before SMTP.
That means: you have to do a POP3 request BEFORE you can send an SMTP request.
 
Share this answer
 
Comments
ManojanbU 11-Jul-16 9:14am    
"That means: you have to do a POP3 request BEFORE you can send an SMTP request".i cant clear this. can you give more explanation ?
Just change port from 25 to 587 and enablessl to false
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900