Sending email with C#

Results 1 to 2 of 2

Thread: Sending email with C#

  1. #1
    Join Date
    Dec 1969

    Default Sending email with C#

    Hi,<BR><BR>I&#039;m new to ASP.NET. I need to send an email from a form which is already built, posting variables to my aspx C# page.<BR><BR>When an ASP.NET page is called, can you not procedurally execute the code on it? The page to which the form is posted is:<BR><BR>&#060;%@ Import Namespace="System.Web.Mail" %&#062;<BR>&#060;script language="c#" runat="server"&#062;<BR><BR>MailMessage msg = new MailMessage();<BR>msg.To = "";<BR>msg.From = "";<BR>msg.Subject = "Subject";<BR>msg.Body = "Body";<BR>SmtpMail.SmtpServer = ""; <BR>SmtpMail.Send(msg); <BR><BR>&#060;/script&#062;<BR><BR>When this page is loaded I get errors (on a shared server so don&#039;t know what these are!!! web.config needs to be changed).<BR><BR>Can somebody also tell me how I will access the posted form variables and get these into my email?<BR><BR>Thank you! <BR> <BR><BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Sending email with C#

    this page is setting the properties of the mail object to literal values - they are NOT variables - they will always be the same

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts