Jump to content
Xtreme .Net Talk

srinivaskr

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by srinivaskr

  1. i have successfully debugged the program but how do i now register it to the uddi registery. i want to use the same web service in another web site which is already running on the web.
  2. how do i register my web service to uddi registery in windows xp sp-3
  3. i have opened a new project as file-> new-> website-> asp.net web service and in the window written the code for the web service and while i was compiling got this error. also when i tried to change the name of the page directive it compiled successfully but am not able to publish the same to the localhost uddi registery.
  4. how do i publish the web service i have written in C#.net on asp.net3.5 platform to the web server. what are the steps to be followed for that. please give me the exact steps to be followed to achieve this task. thanks in advance
  5. using System; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using System.Web.Mail; using System.Net.Mail; [WebService(Namespace = "http://MailServiceSample/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [system.ComponentModel.ToolboxItem(false)] [system.Web.Script.Services.ScriptService] public class SentEmail : System.Web.Services.WebService { [WebMethod] public string Sending_Email(string strEmailAddrFrom,string[] strEmailAddrTo, int intTotalEmailTo, string strAttachement) { EmailAlert NewMail=new EmailAlert(); return NewMail.EmailSent(strEmailAddrFrom,strEmailAddrTo, intTotalEmailTo, strAttachement); } public string EmailSent(string strEmailAddrFrom, string [] strEmailAddrTo, int intTotalEmailTo, string strAttachement) { string strSent= " "; try { System.Net.Mail.MailMessage myMailMessage = new System.Net.Mail.MailMessage(); myMailMessage.From = new MailAddress(strEmailAddrFrom, "Admin"); myMailMessage.Subject = "Error On Optimizer Program"; myMailMessage.Body = "Error On Optimizer Program.Please check the detail from the attachment"; myMailMessage.IsBodyHtml = true; myMailMessage.Priority = System.Net.Mail.MailPriority.High; for (int NumberOfEmails = 0; NumberOfEmails < intTotalEmailTo; NumberOfEmails++) { myMailMessage.To.Add(new MailAddress(strEmailAddrTo[NumberOfEmails])); } if (strAttachement != "" || strAttachement != null) { Attachment att = new Attachment(strAttachement); myMailMessage.Attachments.Add(att); } SmtpClient myMailClient = new SmtpClient(); myMailClient.Host = "www.mymailhost.net"; myMailClient.Port = 25; myMailClient.DeliveryMethod = SmtpDeliveryMethod.Network; object userState = myMailMessage; try { Console.WriteLine("Mail Sending In progress"); myMailClient.Send(myMailMessage); } catch (System.Net.Mail.SmtpException ex) { Console.WriteLine(ex.Message, "Send Mail Error"); strSent = strSent + ex.Message; } myMailMessage.Dispose(); strSent = "Mail Sent !!"; } catch (System.Net.Mail.SmtpException exSmtp) { Console.WriteLine("Exception occurred:" + exSmtp.Message, "SMTP Exception Error"); strSent = strSent + "Exception occurred:" + exSmtp.Message; } catch (System.Exception exGen) { Console.WriteLine("Exception occurred:" + exGen.Message, "General Exception Error"); strSent = strSent + "Exception occurred:" + exGen.Message; } return strSent; } } the above code is returning error in line EmailAlert NewMail=new EmailAlert(); it says missing directive or assembly reference for EmailAlert. please help me resolve this problem.
  6. the program gave me a parse error in the directive statement <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %> the error describes that the service cannot be created.
  7. using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls. WebParts; using System.Web.UI.HtmlControls; using System.Net.Mail; public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { //Calling the function SendMail Response.Write(SendMail("abc@gmail.com", "def@gmail.com", "ghi@yahoo.com", "Test Mail", "Test Mail Body")); } public string SendMail(string toList, string from, string ccList, string subject, string body) { MailMessage message = new MailMessage(); SmtpClient smtpClient = new SmtpClient(); string msg = string.Empty; try { MailAddress fromAddress = new MailAddress(from); message.From = fromAddress; message.To.Add(toList); if (ccList != null && ccList != string.Empty) message.CC.Add(ccList); message.Subject = subject; message.IsBodyHtml = true; message.Body = body; smtpClient.Host = "mail.server.com"; smtpClient.Port = 25; smtpClient.UseDefaultCredentials = true; smtpClient.Credentials = new System.Net.NetworkCredential("info@server.com", "password"); smtpClient.Send(message); msg = "Successful"; } catch (Exception ex) { msg = ex.Message; } return msg; } } the above is the web service code written to send a email from flex application. but this code is not working. can anyone help me debug the application.
×
×
  • Create New...