Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to send an email using smtp server to other domains?

Eg - Email id - info@icon.com
host - www.icon.com

Thanks :)

Regards
harsha :)
Posted
Updated 27-Jun-12 0:59am
v2

You probably need some authentication, ssl, or trust from other party's side. It depends on several configuration and infrastructure settings. You provided far too few details. Have you got any error message, have you tried with telnet?...
 
Share this answer
 
Comments
Harsha Dev 27-Jun-12 7:13am    
yeah zoltan zorgo i tried but i am getting errors!!! wait i will post the kind of error which i am getting...
hope u can help me from that error :)
Harsha Dev 27-Jun-12 7:17am    
Error

System.Net.Mail.SmtpException: Insufficient system storage. The server response was: 4.3.1 Out of memory at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at _Default.Btn_SendMail_Click(Object sender, EventArgs e) in c:\Documents and Settings\User\My Documents\Visual Studio 2008\WebSites\Email\Default.aspx.cs:line 25
Zoltán Zörgő 27-Jun-12 8:33am    
How exactly is your smtp client configured? As you can see here: http://technet.microsoft.com/en-us/library/bb232118.aspx the 4.3.1 status code you receive is related to storage problems on smtp server (supposing Exchange) side.
Harsha Dev 27-Jun-12 7:22am    
Can some one help me how to go on with email sending step by step procedure!!! :)
C#
string Email = abc@abc.com

 SmtpClient client = new SmtpClient(ServerIPAddress);

 MailMessage  message = new MailMessage(messenger@abc.com,Email.Trim());

 message.Subject ="Hi this is Ayush Chaudhary";

 client.Credentials = new System.Net.NetworkCredential("MailServerUserName","Pwd");
             
 client.Port = System.Convert.ToInt32(PortNo);

 client.Send(message);




By Default port number is 25

for sending mail to other domain you have to give your domain username or password.

Is this post is relevant for you................ This sample can send mail to any other domain and in domain.
 
Share this answer
 
v2
Comments
Harsha Dev 28-Jun-12 4:27am    
hope it will be useful... i will try and come back to u...

Thanks :)

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