slade8200 Posted April 29, 2010 Share Posted April 29, 2010 I'm new to this .NET stuff, but seem have my email code almost working. When the run the code, it has an error on the "Imports" statements. I've searched all over the place and seen many different ways of doing it and has so far confused me. I'd love it if someone could point me in the right direction. <html><body><%'@Import Namespace="System.Web.Mail"Imports System;Imports System.Web.Mail;Dim firstName as StringDim lastName as StringDim address as StringfirstName = Request.QueryString("FirstName")lastName = Request.QueryString("LastName")address = Request.QueryString("address")Response.Write(firstName)Response.Write(lastName)Response.Write(address)Dim msg As MailMessage = New MailMessage()msg.To = "x123@xcommunications.com"msg.From = "me@test.com"msg.Subject = "Test message"msg.BodyFormat = MailFormat.Textmsg.Body = "Message body"SmtpMail.SmtpServer = "10.10.10.6"TrySmtpMail.Send(msg)Catch ex As HttpExceptionResponse.Write("Error: " + ex.ToString())Catch ex As ExceptionResponse.Write("Error: " + ex.ToString())End Try%></body></html> Link to comment Share on other sites More sharing options...
Synook Posted May 1, 2010 Share Posted May 1, 2010 What is the error? Are you sure you're supposed to have those semicolons in there? Link to comment Share on other sites More sharing options...
slade8200 Posted May 3, 2010 Author Share Posted May 3, 2010 Here's the error. I took out the semi-colons and the "Imports System" line. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.