Senior & Expert .Net Developers Discussion Forum by Nyros Technologies

HIRE .Net Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Web Service for sending Email in asp.net with c#

 
Post new topic   Reply to topic    Senior & Expert .Net Developers Discussion Forum by Nyros Technologies Index -> Web Services and other distributed Technologies
View previous topic :: View next topic  
Author Message
vamsy



Joined: 21 Aug 2007
Posts: 60

PostPosted: Thu May 08, 2008 4:22 am    Post subject: Web Service for sending Email in asp.net with c# Reply with quote

hi experts,
i am developing a application which contains apart of sending email with the help web service. can any help how to send email. favor me for this context ASAP.
thanking you in advance.

with regards,
vamsy
Back to top
View user's profile Send private message Send e-mail
manoj



Joined: 21 Aug 2007
Posts: 102

PostPosted: Fri May 09, 2008 11:09 am    Post subject: Reply with quote

hi vamsy ,
here is the web method for sending email by using web service. web method is a method which can be consume by the client from client system by just giving web reference in Solution Explorer of visual studio frame work.


[WebMethod]
public string SendActivationEmail(string EmailID, string EmailActivationKey)
{
SmtpClient sc = new SmtpClient();
MailAddress From = new MailAddress("noreply@Test.com", "AndhraSMS.com");
MailAddress To = new MailAddress(EmailID, "*");
MailMessage mail = new MailMessage(From, To);
string BodyMessage = "Hello, \n";
BodyMessage = BodyMessage + " Thank you for registering on *.com. To activate your account.\n Enter the following code:";
mail.Body = BodyMessage + EmailActivationKey + "\n\n Sincerely, \n AndhraSMS Admin.";
mail.Subject = "*";
mail.Priority = MailPriority.High;
sc.Send(mail);

return "Sent Sucessfully";


}


try this code snippet . it will be help you a bit


enjoy the coding...
Back to top
View user's profile Send private message Send e-mail
vamsy



Joined: 21 Aug 2007
Posts: 60

PostPosted: Fri May 09, 2008 11:20 am    Post subject: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavai Reply with quote

hi,
i tried the code snippet but i can not able to send email. any one help me in this context situation. while sending email i am getting following error that
"System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable".
thanking you inadvance....
with regards,
vamsy
Back to top
View user's profile Send private message Send e-mail
muralikrishna



Joined: 21 Aug 2007
Posts: 36

PostPosted: Fri May 09, 2008 11:24 am    Post subject: Reply with quote

hi, you did not present exact code. but i'll solve your problem while sending email. it might be a factor. please put the smtp mail server credential in web.Config. in following section

<system.net>
<mailSettings>
<smtp>

<network host="mail.test.com" port="25" userName="smtp@test.com" password="*"/>
</smtp>



</mailSettings>
</system.net>
here port 25 is the default port for smtp.
try this . it may solve your problem in sending email.
keep on posting.....
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert .Net Developers Discussion Forum by Nyros Technologies Index -> Web Services and other distributed Technologies
Page 1 of 1


 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts Is there any control like Gridview in WPF?
1 mukundh 12 Fri Jul 30, 2010 11:16 am
setty View latest post
No new posts Getting data from the other pages by sending a request.
1 pavani 8 Fri Jul 30, 2010 10:16 am
rajesh View latest post
No new posts Viewing or Reading an Assembly
0 sek 20 Mon Jul 26, 2010 10:33 am
sek View latest post
No new posts Multiple technologies to develop iPhone applications:
0 Ramya sree 21 Mon Jul 26, 2010 10:09 am
Ramya sree View latest post
No new posts What is the Difference Between CLR, CLS and CTS ?
1 pavani 27 Mon Jul 26, 2010 5:35 am
pavani View latest post
No new posts What is Android and How to install Android SDK.??
0 pavani 17 Mon Jul 26, 2010 4:46 am
pavani View latest post
No new posts Open-source libraries for iPhone application development:-
0 Teena 19 Sun Jul 25, 2010 8:17 am
Teena View latest post
No new posts Famous Mobile Sites:
1 kumar 17 Sun Jul 25, 2010 7:33 am
Teena View latest post
No new posts Introduction to PhoneGap framework
0 Dileep 24 Sun Jul 25, 2010 7:00 am
Dileep View latest post
No new posts Objective-C on Windows:
0 suraj 22 Sun Jul 25, 2010 6:16 am
suraj View latest post




Hire an expert .Net developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   PHP   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About .Net Experts   |   More