im useless
im useless

Reputation: 7461

Passing a MailMessage object to a web service

Can anyone please tell me if it's possible to pass a System.Web.Mail.MailMessage object to a ASP.NET Web Service? Maybe using XML Serialization / Deserialization? I've been asked to investigate the possibility of building a front-end web page which captures MailMessage properties such To, From Subject, Attachments etc, builds a MailMessage object, passes the MailMessage object to a web service, the web service then sends the message via the Smtp.Send method.

Any assistance gratefully received. Thanks!

Upvotes: 0

Views: 235

Answers (1)

Michael Minton
Michael Minton

Reputation: 4495

Certainly this can be done using web services. WCF would make this extremely simple. Just create a new WCF web service and the method would look something like this:

[WebMethod]
public bool ReceiveMailMessage(MailMessage mm)
{
   //Send the MM
   return true;  
}

Upvotes: 2

Related Questions