Email Variable

Results 1 to 2 of 2

Thread: Email Variable

  1. #1
    Join Date
    Dec 1969

    Default Email Variable

    I have the follwing email code, but I cant get it to take the value from the forms feild and put that email address in the objMailMessage.To collum<BR><BR>&#060;asp:TextBox<BR> ID="txtEmail"<BR> Width="155"<BR> Runat="Server" /&#062;<BR><BR><BR>objMailMessage = New MailMessage<BR> objMailMessage.From = "Registration @ BlueMist Online"<BR> objMailMessage.To = (&#039;" & txtEmail.Text & "&#039;)<BR> objMailMessage.Subject = "BlueMist Online Email Validation"<BR> objMailMessage.Body = strHTMLBody<BR> objMailMessage.BodyFormat = MailFormat.Html<BR> objMailMessage.Priority = MailPriority.High<BR> SmtpMail.Send( objMailMessage )<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Email Variable

    &nbsp;<BR> Have you executed the code written? does it give any error? if yes. whats the error?<BR> if no , try to Response.write txtEmail.Text.<BR> AND setting should be<BR> objMailMessage.To = txtEmail.Text <BR>AND NO <BR>objMailMessage.To = (&#039;" & txtEmail.Text & "&#039;)<BR>because txtEmail.Text returns string, so double quotes around the txtEmail.Text are not required.<BR><BR>

Posting Permissions

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