E-MAILING FORM ON SUBMIT

I have setup the attached form that sends data to an MS Access Data Base on Submit.   I would like to also send a copy of the form via e-mail (MS Outlook) to multiple recipients simultaneously on Submit.  I need help with the developement of the "Code Behind" to accomplish this.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MELInsert.aspx.cs" Inherits="MELInsert" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server"> 
    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
            Dim con As New System.Data.OleDb.OleDbConnection 
 
        Dim myPath As String 
        myPath = Server.MapPath("database2.mdb") 
 
        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
        Dim myCommand As New System.Data.OleDb.OleDbCommand 
 
        myCommand.CommandText = String.Format("INSERT INTO mel([dates],[assigned],[completed],[deferred],[lead],[Ship1],[Log1],[MEL1],[Def1],[Part1],[Ship2],[Log2],[MEL2],[Def2],[Part2],[Ship3],[Log3],[MEL3],[Def3],[Part3],[Ship4],[Log4],[MEL4],[Def4],[Part4],[Ship5],[Log5],[MEL5],[Def5],[Part5],[Ship6],[Log6],[MEL6],[Def6],[Part6],[Ship7],[Log7],[MEL7],[Def7],[Part7],[Ship8],[Log8],[MEL8],[Def8],[Part8]) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}')", DateTime.Parse(Dates.Text), Assigned.Text, Completed.Text, Deferred.Text, Lead.Text, Ship1.Text, Log1.Text, MEL1.Text, Def1.Text, Part1.Text, Ship2.Text, Log2.Text, MEL2.Text, Def2.Text, Part2.Text, Ship3.Text, Log3.Text, MEL3.Text, Def3.Text, Part3.Text, Ship4.Text, Log4.Text, MEL4.Text, Def4.Text, Part4.Text, Ship5.Text, Log5.Text, MEL5.Text, Def5.Text, Part5.Text, Ship6.Text, Log6.Text, MEL6.Text, Def6.Text, Part6.Text, Ship7.Text, Log7.Text, MEL7.Text, Def7.Text, Part7.Text, Ship8.Text, Log8.Text, MEL8.Text, Def8.Text, Part8.Text) 
        myCommand.Connection = con 
        con.Open() 
        myCommand.ExecuteNonQuery() 
        con.Close() 
                Response.Redirect("http://delta.laxpm.com") 
    End Sub 

Private Sub Completed_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Completed.TextChanged

      	Deferred.Text = (Cdbl(Assigned.text) - cdbl(Completed.Text))

    End Sub
</script>
 

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<style type="text/css">
.style1 {
	border-color: #c0c0c0;
	border-width: 0;
	background-color: #ffffff;
}
.style3 {
	text-align: center;
}
.style4 {
	font-size: small;
	font-family: Arial;
	text-align: center;
}
.style5 {
	text-align: center;
	font-family: Arial;
}
.style9 {
	text-align: left;
}
.style10 {
	font-size: small;
	font-family: Arial;
	text-align: left;
}
.style11 {
	border-left: 1px solid #C0C0C0;
	border-right-style: solid;
	border-right-width: 1px;
	border-top: 1px solid #C0C0C0;
	border-bottom-style: solid;
	border-bottom-width: 1px;
}
.style12 {
	border-left: 1px solid #C0C0C0;
	border-top: 1px solid #C0C0C0;
	text-align: center;
	border-right-style: solid;
	border-right-width: 1px;
	border-bottom-style: solid;
	border-bottom-width: 1px;
}
.style13 {
	border-left: 1px solid #C0C0C0;
	border-top: 1px solid #C0C0C0;
	text-align: left;
	border-right-style: solid;
	border-right-width: 1px;
	border-bottom-style: solid;
	border-bottom-width: 1px;
}
.style14 {
	font-size: small;
	font-family: Arial;
}
.style15 {
	font-family: Arial;
}
</style>
</head>

<body>
<form id="form1" runat="server">
	<p>&nbsp;</p>
	<p class="style5">LAX MEL Completion Form</p>
	<table style="width: 900px" cellpadding="0" cellspacing="0" class="style1" align="center">
		<tr>
			<td>
			
			
			<asp:Button runat="server" Text="Submit" id="btnSubmit" Width="85px" 
                    onclick="btnSubmit_Click" Height="26px" />&nbsp;</td>
		</tr>
	</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" align="center" class="style1">
		<tr>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
		</tr>
		<tr>
			<td style="width: 200px" class="style10">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date</td>
			<td style="width: 200px" class="style4">Assigned</td>
			<td style="width: 200px" class="style4">Completed</td>
			<td style="width: 200px" class="style4">Deferred</td>
		</tr>
		<tr>
			<td style="width: 200px; height: 21px" class="style9">
       <asp:TextBox ID="Dates" style="text-align:center" Runat="server" />
       
       &nbsp;<a href="javascript:;" onclick="window.open('popup.aspx?textbox=Dates','cal','width=250,height=225,left=270,top=180')"><img src="SmallCalendar.gif" border="0" width="16" height="16"></a> </td>&nbsp;</td>
     <td class="style3" style="width: 200px">
<asp:TextBox runat="server" style="text-align:center" id="Assigned" AutoPostBack="True"></asp:TextBox>
&nbsp;</td>
     <td align="center" style="height: 21px; width: 200px;">
<asp:TextBox runat="server" style="text-align:center" id="Completed" AutoPostBack="True"></asp:TextBox>
&nbsp;</td>
			<td style="height: 21px; width: 200px;" class="style3">
			<asp:TextBox runat="server" style="text-align:center" id="Deferred"></asp:TextBox>
			&nbsp;</td>
		</tr>
		<tr>
			<td style="width: 200px" class="style9">
			&nbsp;&nbsp; <span class="style15">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</span>
			<asp:RequiredFieldValidator runat="server" ErrorMessage="Select Date" id="RequiredFieldValidator1"
			ControlToValidate="Dates" Font-Size="Small" Font-Names="Arial">
			</asp:RequiredFieldValidator>
			<span class="style14">&nbsp;</span></td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
		</tr>
		</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" align="center" class="style1">
		<tr>
			<td class="style5"><br />
			<table style="width: 800px" cellpadding="0" cellspacing="0" class="style1">
				<tr>
					<td>&nbsp;</td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" align="center" class="style1">
		<tr>
			<td style="width: 73px" class="style10">&nbsp;&nbsp;&nbsp;Ship</td>
			<td class="style4" style="width: 98px">Logpage</td>
			<td class="style4" style="width: 191px">MEL Description</td>
			<td class="style4" style="width: 222px">Reason For Deferral</td>
			<td class="style4">Comments &amp; Part/Tooling Information</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship1" Width="51px">
			</asp:TextBox>
			&nbsp;</td>
			<td class="style12" style="width: 98px">
			<asp:TextBox runat="server" id="Log1" Width="81px">
			</asp:TextBox>
			</td>
			<td class="style12" style="width: 191px">
			<asp:TextBox runat="server" id="MEL1" Width="172px">
			</asp:TextBox>
			</td>
			<td class="style12" style="width: 222px">
			<asp:DropDownList runat="server" style="text-align:center" id="Def1" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part1" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style11">
			<asp:TextBox runat="server" style="text-align:center" id="Ship2" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log2" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL2" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def2" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part2" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship3" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log3" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL3" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def3" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part3" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship4" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log4" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL4" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def4" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part4" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship5" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log5" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL5" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def5" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part5" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship6" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log6" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL6" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def6" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part6" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship7" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log7" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL7" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def7" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part7" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship8" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log8" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL8" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def8" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part8" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style9">&nbsp;</td>
			<td style="width: 98px">&nbsp;</td>
			<td style="width: 191px">&nbsp;</td>
			<td style="width: 222px">&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" class="style1" align="center">
		<tr>
			<td class="style10" style="width: 98px">Submitted By:</td>
			<td>
			
			<asp:DropDownList runat="server" style="text-align:left" id="Lead" Width="152px" Height="22px" DataValueField="Lead" DataTextField="Lead" DataSourceID="AccessDataSource1">
			</asp:DropDownList>
			
			&nbsp;
			<span class="style19">
			<asp:RequiredFieldValidator runat="server" ErrorMessage="Select Name" id="RequiredFieldValidator2"
			ControlToValidate="Lead" Font-Size="Small" Font-Names="Arial">
			</asp:RequiredFieldValidator>

			<asp:AccessDataSource runat="server" ID="AccessDataSource1" DataFile="database2.mdb" SelectCommand="SELECT DISTINCT [Lead] FROM [Droplist]">
			</asp:AccessDataSource>
			
			&nbsp;<asp:AccessDataSource runat="server" ID="AccessDataSource2" DataFile="database2.mdb" SelectCommand="SELECT [Reason2], [Reason1], [Reason3], [Reason4], [Reason5], [Reason6], [Reason7], [Lead], [Reason8] FROM [Droplist]">
			</asp:AccessDataSource>
			</td>
		</tr>
		<tr>
			<td style="width: 98px">&nbsp;</td>
			<td>
			
			</td>
		</tr>
	</table>
</form>

</body>

</html>


Code Behind?????

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Insert : System.Web.UI.Page
{
    
                             
        }
    }
    
    }

Open in new window

Doc6.doc
BOEING39Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

meetingexpectationsCommented:



Imports System.Net.Mail

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
            Dim con As New System.Data.OleDb.OleDbConnection 
 
        Dim myPath As String 
        myPath = Server.MapPath("database2.mdb") 
 
        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
        Dim myCommand As New System.Data.OleDb.OleDbCommand 
 
        myCommand.CommandText = String.Format("INSERT INTO mel([dates],[assigned],[completed],[deferred],[lead],[Ship1],[Log1],[MEL1],[Def1],[Part1],[Ship2],[Log2],[MEL2],[Def2],[Part2],[Ship3],[Log3],[MEL3],[Def3],[Part3],[Ship4],[Log4],[MEL4],[Def4],[Part4],[Ship5],[Log5],[MEL5],[Def5],[Part5],[Ship6],[Log6],[MEL6],[Def6],[Part6],[Ship7],[Log7],[MEL7],[Def7],[Part7],[Ship8],[Log8],[MEL8],[Def8],[Part8]) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}')", DateTime.Parse(Dates.Text), Assigned.Text, Completed.Text, Deferred.Text, Lead.Text, Ship1.Text, Log1.Text, MEL1.Text, Def1.Text, Part1.Text, Ship2.Text, Log2.Text, MEL2.Text, Def2.Text, Part2.Text, Ship3.Text, Log3.Text, MEL3.Text, Def3.Text, Part3.Text, Ship4.Text, Log4.Text, MEL4.Text, Def4.Text, Part4.Text, Ship5.Text, Log5.Text, MEL5.Text, Def5.Text, Part5.Text, Ship6.Text, Log6.Text, MEL6.Text, Def6.Text, Part6.Text, Ship7.Text, Log7.Text, MEL7.Text, Def7.Text, Part7.Text, Ship8.Text, Log8.Text, MEL8.Text, Def8.Text, Part8.Text) 
        myCommand.Connection = con 
        con.Open() 
        myCommand.ExecuteNonQuery() 
        con.Close() 

'Send Email
Dim smtpClient As SmtpClient = New SmtpClient()
Dim message As MailMessage = New MailMessage()
Dim fromAddress As MailAddress = New MailAddress("email@email.com", "Email Name")
message.From = fromAddress
message.To.Add(txtEmail.Text)
message.Subject = "Form"

Dim palinBody As String = "Assigned: " & Assigned.Text & ", Completed: " &  Completed.Text _
                   + "Deferred: " & Deferred.Text _
               ' AND SO ON....
Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
Dim htmlBody As String = "<p>Assigned: " & Assigned.Text & "<br />" _
                '    + "Completed: " & Completed.Text & "<br />" _
                '    + "Deferred: " & Deferred.Text & "<br />"
' and so on....
Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(htmlBody, Nothing, "text/html")
message.AlternateViews.Add(plainView)
message.AlternateViews.Add(htmlView)
message.Priority = MailPriority.High
smtpClient.Host = "localhost"
smtpClient.Send(message)

Response.Redirect("http://delta.laxpm.com") 
    End Sub 

Open in new window

0
BOEING39Author Commented:
Please find attached:

Where do I place the recipients e-mail addresses?

With the code beihind can I eliminated the script on the main form page?


mel-form.txt
0
meetingexpectationsCommented:
Recepient's email address goes in message.To.Add("a@a.com"). You can also add message.CC.Add("b@b.com")

You are creating the form tn the body of the message. You cannot just grap your aspx form and send it.

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

BOEING39Author Commented:
Ok I am getting the folowing errors:


1.   (MELInsert.aspx)
  .........  VB Code error stating   "Context" is not a member of "MELInsert"
<%@ Page Language="vb" AutoEventWireup="False" CodeFile="MELInsert.aspx.vb" Inherits="MELInsert" %>

2. (MELInsert.aspx.vb) ........ Code error
........STATEMENT is not valid in Namespace
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)

3.  On Submit I get the following Compilation Error
Line 1:  Imports System.Net.Mail
Line 2:  
Line 3:  Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
 

Source File: C:\Users\Mark\Documents\manager.laxpm.com\MEL\MELInsert.aspx.vb    Line: 1







<%@ Page Language="vb" AutoEventWireup="False" CodeFile="MELInsert.aspx.vb" Inherits="MELInsert" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<style type="text/css">
.style1 {
	border-color: #c0c0c0;
	border-width: 0;
	background-color: #ffffff;
}
.style3 {
	text-align: center;
}
.style4 {
	font-size: small;
	font-family: Arial;
	text-align: center;
}
.style5 {
	text-align: center;
	font-family: Arial;
}
.style9 {
	text-align: left;
}
.style10 {
	font-size: small;
	font-family: Arial;
	text-align: left;
}
.style11 {
	border-left: 1px solid #C0C0C0;
	border-right-style: solid;
	border-right-width: 1px;
	border-top: 1px solid #C0C0C0;
	border-bottom-style: solid;
	border-bottom-width: 1px;
}
.style12 {
	border-left: 1px solid #C0C0C0;
	border-top: 1px solid #C0C0C0;
	text-align: center;
	border-right-style: solid;
	border-right-width: 1px;
	border-bottom-style: solid;
	border-bottom-width: 1px;
}
.style13 {
	border-left: 1px solid #C0C0C0;
	border-top: 1px solid #C0C0C0;
	text-align: left;
	border-right-style: solid;
	border-right-width: 1px;
	border-bottom-style: solid;
	border-bottom-width: 1px;
}
.style14 {
	font-size: small;
	font-family: Arial;
}
.style15 {
	font-family: Arial;
}
</style>
</head>

<body>
<form id="form1" runat="server">
	<p>&nbsp;</p>
	<p class="style5">LAX MEL Completion Form</p>
	<table style="width: 900px" cellpadding="0" cellspacing="0" class="style1" align="center">
		<tr>
			<td>
			
			
			<asp:Button runat="server" Text="Submit" id="btnSubmit" Width="85px" 
                    onclick="btnSubmit_Click" Height="26px" />&nbsp;</td>
		</tr>
	</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" align="center" class="style1">
		<tr>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
		</tr>
		<tr>
			<td style="width: 200px" class="style10">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date</td>
			<td style="width: 200px" class="style4">Assigned</td>
			<td style="width: 200px" class="style4">Completed</td>
			<td style="width: 200px" class="style4">Deferred</td>
		</tr>
		<tr>
			<td style="width: 200px; height: 21px" class="style9">
       <asp:TextBox ID="Date" style="text-align:center" Runat="server" />
       
       &nbsp;<a href="javascript:;" onclick="window.open('popup.aspx?textbox=Dates','cal','width=250,height=225,left=270,top=180')"><img src="SmallCalendar.gif" border="0" width="16" height="16"></a> </td>&nbsp;</td>
     <td class="style3" style="width: 200px">
<asp:TextBox runat="server" style="text-align:center" id="Assigned" AutoPostBack="True"></asp:TextBox>
&nbsp;</td>
     <td align="center" style="height: 21px; width: 200px;">
<asp:TextBox runat="server" style="text-align:center" id="Completed" AutoPostBack="True"></asp:TextBox>
&nbsp;</td>
			<td style="height: 21px; width: 200px;" class="style3">
			<asp:TextBox runat="server" style="text-align:center" id="Deferred"></asp:TextBox>
			&nbsp;</td>
		</tr>
		<tr>
			<td style="width: 200px" class="style9">
			&nbsp;&nbsp; <span class="style15">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</span>
			<asp:RequiredFieldValidator runat="server" ErrorMessage="Select Date" id="RequiredFieldValidator1"
			ControlToValidate="Dates" Font-Size="Small" Font-Names="Arial">
			</asp:RequiredFieldValidator>
			<span class="style14">&nbsp;</span></td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
			<td style="width: 200px" class="style3">&nbsp;</td>
		</tr>
		</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" align="center" class="style1">
		<tr>
			<td class="style5"><br />
			<table style="width: 800px" cellpadding="0" cellspacing="0" class="style1">
				<tr>
					<td>&nbsp;</td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" align="center" class="style1">
		<tr>
			<td style="width: 73px" class="style10">&nbsp;&nbsp;&nbsp;Ship</td>
			<td class="style4" style="width: 98px">Logpage</td>
			<td class="style4" style="width: 191px">MEL Description</td>
			<td class="style4" style="width: 222px">Reason For Deferral</td>
			<td class="style4">Comments &amp; Part/Tooling Information</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship1" Width="51px">
			</asp:TextBox>
			&nbsp;</td>
			<td class="style12" style="width: 98px">
			<asp:TextBox runat="server" id="Log1" Width="81px">
			</asp:TextBox>
			</td>
			<td class="style12" style="width: 191px">
			<asp:TextBox runat="server" id="MEL1" Width="172px">
			</asp:TextBox>
			</td>
			<td class="style12" style="width: 222px">
			<asp:DropDownList runat="server" style="text-align:center" id="Def1" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part1" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style11">
			<asp:TextBox runat="server" style="text-align:center" id="Ship2" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log2" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL2" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def2" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part2" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship3" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log3" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL3" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def3" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part3" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship4" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log4" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL4" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def4" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part4" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship5" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log5" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL5" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def5" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part5" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship6" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log6" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL6" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def6" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part6" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship7" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log7" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL7" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def7" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part7" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style13">
			<asp:TextBox runat="server" style="text-align:center" id="Ship8" Width="51px">
			</asp:TextBox>
			</td>
			<td style="width: 98px" class="style12">
			<asp:TextBox runat="server" id="Log8" Width="81px">
			</asp:TextBox>
			</td>
			<td style="width: 191px" class="style12">
			<asp:TextBox runat="server" id="MEL8" Width="172px">
			</asp:TextBox>
			</td>
			<td style="width: 222px" class="style12">
			<asp:DropDownList runat="server" style="text-align:center" id="Def8" Width="204px" Height="22px" DataValueField="Reason1" DataTextField="Reason1" DataSourceID="AccessDataSource2">
			</asp:DropDownList>
			</td>
			<td class="style12">
			<asp:TextBox runat="server" id="Part8" Width="286px">
			</asp:TextBox>
			</td>
		</tr>
		<tr>
			<td style="width: 73px" class="style9">&nbsp;</td>
			<td style="width: 98px">&nbsp;</td>
			<td style="width: 191px">&nbsp;</td>
			<td style="width: 222px">&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		</table>
	<table style="width: 900px" cellpadding="0" cellspacing="0" class="style1" align="center">
		<tr>
			<td class="style10" style="width: 98px">Submitted By:</td>
			<td>
			
			<asp:DropDownList runat="server" style="text-align:left" id="Lead" Width="152px" Height="22px" DataValueField="Lead" DataTextField="Lead" DataSourceID="AccessDataSource1">
			</asp:DropDownList>
			
			&nbsp;
			<span class="style19">
			<asp:RequiredFieldValidator runat="server" ErrorMessage="Select Name" id="RequiredFieldValidator2"
			ControlToValidate="Lead" Font-Size="Small" Font-Names="Arial">
			</asp:RequiredFieldValidator>

			<asp:AccessDataSource runat="server" ID="AccessDataSource1" DataFile="database2.mdb" SelectCommand="SELECT DISTINCT [Lead] FROM [Droplist]">
			</asp:AccessDataSource>
			
			&nbsp;<asp:AccessDataSource runat="server" ID="AccessDataSource2" DataFile="database2.mdb" SelectCommand="SELECT [Reason2], [Reason1], [Reason3], [Reason4], [Reason5], [Reason6], [Reason7], [Lead], [Reason8] FROM [Droplist]">
			</asp:AccessDataSource>
			</td>
		</tr>
		<tr>
			<td style="width: 98px">&nbsp;</td>
			<td>
			
			</td>
		</tr>
	</table>
</form>

</body>

</html>


CODE BEHIND:..........................................

Imports System.Net.Mail

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
            Dim con As New System.Data.OleDb.OleDbConnection 
 
        Dim myPath As String 
        myPath = Server.MapPath("database2.mdb") 
 
        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
        Dim myCommand As New System.Data.OleDb.OleDbCommand 
 
        myCommand.CommandText = String.Format("INSERT INTO mel([dates],[assigned],[completed],[deferred],[lead],[Ship1],[Log1],[MEL1],[Def1],[Part1],[Ship2],[Log2],[MEL2],[Def2],[Part2],[Ship3],[Log3],[MEL3],[Def3],[Part3],[Ship4],[Log4],[MEL4],[Def4],[Part4],[Ship5],[Log5],[MEL5],[Def5],[Part5],[Ship6],[Log6],[MEL6],[Def6],[Part6],[Ship7],[Log7],[MEL7],[Def7],[Part7],[Ship8],[Log8],[MEL8],[Def8],[Part8]) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}')", DateTime.Parse(Date.Text), Assigned.Text, Completed.Text, Deferred.Text, Lead.Text, Ship1.Text, Log1.Text, MEL1.Text, Def1.Text, Part1.Text, Ship2.Text, Log2.Text, MEL2.Text, Def2.Text, Part2.Text, Ship3.Text, Log3.Text, MEL3.Text, Def3.Text, Part3.Text, Ship4.Text, Log4.Text, MEL4.Text, Def4.Text, Part4.Text, Ship5.Text, Log5.Text, MEL5.Text, Def5.Text, Part5.Text, Ship6.Text, Log6.Text, MEL6.Text, Def6.Text, Part6.Text, Ship7.Text, Log7.Text, MEL7.Text, Def7.Text, Part7.Text, Ship8.Text, Log8.Text, MEL8.Text, Def8.Text, Part8.Text) 
        myCommand.Connection = con 
        con.Open() 
        myCommand.ExecuteNonQuery() 
        con.Close() 

'Send Email
Dim smtpClient As SmtpClient = New SmtpClient()
Dim message As MailMessage = New MailMessage()
Dim fromAddress As MailAddress = New MailAddress("email@email.com", "Email Name")   
message.From = fromAddress                                                          
message.To.Add("mark@laxpm.com")
message.Subject = "LAX MEL Form"

Dim palinBody As String = "Date: " Date.Text & ", "Assigned: " & Assigned.Text & ", "Completed: " &  Completed.Text & ", "Deferred: " & Deferred.Text & ", "Lead: " & Lead.Text & ", "Ship1: " & Ship1.Text & ", "Log1: " & Log1.Text & ", "MEL1: " & MEL1.Text & ", "Def1: " & Def1.Text & ", "Part1: " & Part1.Text & ", "Ship2: " & Ship2.Text & ", "Log2: " & Log2.Text & ", "MEL2: " & MEL2.Text & ", "Def2: " & Def2.Text & ", "Part2: " & Part2.Text & ", "Ship3: " & Ship3.Text & ", "Log3: " & Log3.Text & ", "MEL3: " & MEL3.Text & ", "Def3: " & Def3.Text & ", "Part3: " & Part3.Text & ", "Ship4: " & Ship4.Text & ", "Log4: " & Log4.Text & ", "MEL4: " & MEL4.Text & ", "Def4: " & Def4.Text & ", "Part4: " & Part4.Text & ", "Ship5: " & Ship5.Text & ", "Log5: " & Log5.Text & ", "MEL5: " & MEL5.Text & ", "Def5: " & Def5.Text & ", "Part5: " & Part5.Text & ", "Ship6: " & Ship6.Text & ", "Log6: " & Log6.Text & ", "MEL6: " & MEL6.Text & ", "Def6: " & Def6.Text & ", "Part6: " & Part6.Text & ", "Ship7: " & Ship7.Text & ", "Log7: " & Log7.Text & ", "MEL7: " & MEL7.Text & ", "Def7: " & Def7.Text & ", "Part7: " & Part7.Text & ", "Ship8: " & Ship8.Text & ", "Log8: " & Log8.Text & ", "MEL8: " & MEL8.Text & ", "Def8: " & Def8.Text & ", "Part8: " & Part8.Text & "

                                  
Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
Dim htmlBody As String = "<p>Lead: " & Lead.Text & "<br />" _
				'	 + "Date: " & Date.Text & ", "Assigned: " & Assigned.Text & ", "Completed: " & Completed.Text & ", "Defered: " & Deferred.Text & "<br />" _
 				'    + "Ship1: " & Ship1.Text & "<br />" _
                '    + "Log1: " & Log1.Text & "<br />" _   
                '    + "MEL1: " & MEL1.Text & "<br />" _
				'    + "Def1: " & Def1.Text & "<br />" _
				'    + "Part1: " & Part1.Text & "<br />" _
				'    + "Ship2: " & Ship2.Text & "<br />" _
                '    + "Log2: " & Log2.Text & "<br />" _   
                '    + "MEL2: " & MEL2.Text & "<br />" _
				'    + "Def2: " & Def2.Text & "<br />" _
				'    + "Part2: " & Part2.Text & "<br />" _
				'    + "Ship3: " & Ship3.Text & "<br />" _
                '    + "Log3: " & Log3.Text & "<br />" _   
                '    + "MEL3: " & MEL3.Text & "<br />" _
				'    + "Def3: " & Def3.Text & "<br />" _
				'    + "Part3: " & Part3.Text & "<br />" _
				'    + "Ship4: " & Ship4.Text & "<br />" _
                '    + "Log4: " & Log4.Text & "<br />" _   
                '    + "MEL4: " & MEL4.Text & "<br />" _
				'    + "Def4: " & Def4.Text & "<br />" _
				'    + "Part4: " & Part4.Text & "<br />" _
				'    + "Ship5: " & Ship5.Text & "<br />" _
                '    + "Log5: " & Log5.Text & "<br />" _   
                '    + "MEL5: " & MEL5.Text & "<br />" _
				'    + "Def5: " & Def5.Text & "<br />" _
				'    + "Part5: " & Part5.Text & "<br />" _
				'    + "Ship6: " & Ship6.Text & "<br />" _
                '    + "Log6: " & Log6.Text & "<br />" _   
                '    + "MEL6: " & MEL6.Text & "<br />" _
				'    + "Def6: " & Def6.Text & "<br />" _
				'    + "Part6: " & Part6.Text & "<br />" _
				'    + "Ship7: " & Ship7.Text & "<br />" _
                '    + "Log7: " & Log7.Text & "<br />" _   
                '    + "MEL7: " & MEL7.Text & "<br />" _
				'    + "Def7: " & Def7.Text & "<br />" _
				'    + "Part7: " & Part7.Text & "<br />" _
				'    + "Ship8: " & Ship8.Text & "<br />" _
                '    + "Log8: " & Log8.Text & "<br />" _   
                '    + "MEL8: " & MEL8.Text & "<br />" _
				'    + "Def8: " & Def8.Text & "<br />" _
				'    + "Part8: " & Part8.Text & "<br />" _

Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(htmlBody, Nothing, "text/html")
message.AlternateViews.Add(plainView)
message.AlternateViews.Add(htmlView)
message.Priority = MailPriority.High
smtpClient.Host = "localhost"
smtpClient.Send(message)

Response.Redirect("http://delta.laxpm.com") 
    End Sub 

Open in new window

0
meetingexpectationsCommented:
When you do imports system.net.mail do you see any squiggly lines under it?
0
BOEING39Author Commented:
YES, WHEN VIEWING IN VISUAL SUTDIO...    LIGHT BLUE
0
BOEING39Author Commented:
here is a copy of what I am getting....
Doc7.doc
0
BOEING39Author Commented:
I changed the .cs code as follows:

1. On "Submit I get the following Server Error.   The data is reaching the MS Access Data Base, however:

Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------

No connection could be made because the target machine actively refused it 127.0............
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0............

Source Error:

Imports System.Net.Mail

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim con As New System.Data.OleDb.OleDbConnection

        Dim myPath As String
        myPath = Server.MapPath("database2.mdb")

        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
        Dim myCommand As New System.Data.OleDb.OleDbCommand

        myCommand.CommandText = String.Format("INSERT INTO mel([dates],[assigned],[completed],[deferred],[lead],[Ship1],[Log1],[MEL1],[Def1],[Part1],[Ship2],[Log2],[MEL2],[Def2],[Part2],[Ship3],[Log3],[MEL3],[Def3],[Part3],[Ship4],[Log4],[MEL4],[Def4],[Part4],[Ship5],[Log5],[MEL5],[Def5],[Part5],[Ship6],[Log6],[MEL6],[Def6],[Part6],[Ship7],[Log7],[MEL7],[Def7],[Part7],[Ship8],[Log8],[MEL8],[Def8],[Part8]) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}')", DateTime.Parse(Dates.Text), Assigned.Text, Completed.Text, Deferred.Text, Lead.Text, Ship1.Text, Log1.Text, MEL1.Text, Def1.Text, Part1.Text, Ship2.Text, Log2.Text, MEL2.Text, Def2.Text, Part2.Text, Ship3.Text, Log3.Text, MEL3.Text, Def3.Text, Part3.Text, Ship4.Text, Log4.Text, MEL4.Text, Def4.Text, Part4.Text, Ship5.Text, Log5.Text, MEL5.Text, Def5.Text, Part5.Text, Ship6.Text, Log6.Text, MEL6.Text, Def6.Text, Part6.Text, Ship7.Text, Log7.Text, MEL7.Text, Def7.Text, Part7.Text, Ship8.Text, Log8.Text, MEL8.Text, Def8.Text, Part8.Text)
        myCommand.Connection = con
        con.Open()
        myCommand.ExecuteNonQuery()
        con.Close()

        'Send Email
        Dim smtpClient As SmtpClient = New SmtpClient()
        Dim message As MailMessage = New MailMessage()
        Dim fromAddress As MailAddress = New MailAddress("mark@laxpm.com", "Email Name")
        message.From = fromAddress
        message.To.Add("mark@laxpm.com")
        message.Subject = "LAX MEL Form"

        Dim palinBody As String = "Assigned: " & Assigned.Text & ", Completed: " & Completed.Text & ", Deferred: " & Deferred.Text & ", Lead: " & Lead.Text & ", Ship1: " & Ship1.Text & ", Log1: " & Log1.Text & ", MEL1: " & MEL1.Text & ", Def1: " & Def1.Text & ", Part1: " & Part1.Text & ", Ship2: " & Ship2.Text & ", Log2: " & Log2.Text & ", MEL2: " & MEL2.Text & ", Def2: " & Def2.Text & ", Part2: " & Part2.Text & ", Ship3: " & Ship3.Text & ", Log3: " & Log3.Text & ", MEL3: " & MEL3.Text & ", Def3: " & Def3.Text & ", Part3: " & Part3.Text & ", Ship4: " & Ship4.Text & ", Log4: " & Log4.Text & ", MEL4: " & MEL4.Text & ", Def4: " & Def4.Text & ", Part4: " & Part4.Text & ", Ship5: " & Ship5.Text & ", Log5: " & Log5.Text & ", MEL5: " & MEL5.Text & ", Def5: " & Def5.Text & ", Part5: " & Part5.Text & ", Ship6: " & Ship6.Text & ", Log6: " & Log6.Text & ", MEL6: " & MEL6.Text & ", Def6: " & Def6.Text & ", Part6: " & Part6.Text & ", Ship7: " & Ship7.Text & ", Log7: " & Log7.Text & ", MEL7: " & MEL7.Text & ", Def7: " & Def7.Text & ", Part7: " & Part7.Text & ", Ship8: " & Ship8.Text & ", Log8: " & Log8.Text & ", MEL8: " & MEL1.Text & ", Def8: " & Def8.Text & ", Part8: " & Part8.Text & ""



        Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
        Dim htmlBody As String = "<p>Lead: " & Lead.Text & "<br />" _
        '	 + "Date: " & Date.Text & ", "Assigned: " & Assigned.Text & ", "Completed: " & Completed.Text & ", "Defered: " & Deferred.Text & "<br />" _
        '    + "Ship1: " & Ship1.Text & "<br />" _
        '    + "Log1: " & Log1.Text & "<br />" _   
        '    + "MEL1: " & MEL1.Text & "<br />" _
        '    + "Def1: " & Def1.Text & "<br />" _
        '    + "Part1: " & Part1.Text & "<br />" _
        '    + "Ship2: " & Ship2.Text & "<br />" _
        '    + "Log2: " & Log2.Text & "<br />" _   
        '    + "MEL2: " & MEL2.Text & "<br />" _
        '    + "Def2: " & Def2.Text & "<br />" _
        '    + "Part2: " & Part2.Text & "<br />" _
        '    + "Ship3: " & Ship3.Text & "<br />" _
        '    + "Log3: " & Log3.Text & "<br />" _   
        '    + "MEL3: " & MEL3.Text & "<br />" _
        '    + "Def3: " & Def3.Text & "<br />" _
        '    + "Part3: " & Part3.Text & "<br />" _
        '    + "Ship4: " & Ship4.Text & "<br />" _
        '    + "Log4: " & Log4.Text & "<br />" _   
        '    + "MEL4: " & MEL4.Text & "<br />" _
        '    + "Def4: " & Def4.Text & "<br />" _
        '    + "Part4: " & Part4.Text & "<br />" _
        '    + "Ship5: " & Ship5.Text & "<br />" _
        '    + "Log5: " & Log5.Text & "<br />" _   
        '    + "MEL5: " & MEL5.Text & "<br />" _
        '    + "Def5: " & Def5.Text & "<br />" _
        '    + "Part5: " & Part5.Text & "<br />" _
        '    + "Ship6: " & Ship6.Text & "<br />" _
        '    + "Log6: " & Log6.Text & "<br />" _   
        '    + "MEL6: " & MEL6.Text & "<br />" _
        '    + "Def6: " & Def6.Text & "<br />" _
        '    + "Part6: " & Part6.Text & "<br />" _
        '    + "Ship7: " & Ship7.Text & "<br />" _
        '    + "Log7: " & Log7.Text & "<br />" _   
        '    + "MEL7: " & MEL7.Text & "<br />" _
        '    + "Def7: " & Def7.Text & "<br />" _
        '    + "Part7: " & Part7.Text & "<br />" _
        '    + "Ship8: " & Ship8.Text & "<br />" _
        '    + "Log8: " & Log8.Text & "<br />" _   
        '    + "MEL8: " & MEL8.Text & "<br />" _
        '    + "Def8: " & Def8.Text & "<br />" _
        '    + "Part8: " & Part8.Text & "<br />" _

        Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(htmlBody, Nothing, "text/html")
        message.AlternateViews.Add(plainView)
        message.AlternateViews.Add(htmlView)
        message.Priority = MailPriority.High
        smtpClient.Host = "localhost"
        smtpClient.Send(message)

        Response.Redirect("http://delta.laxpm.com")

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
End Class

Open in new window

0
BOEING39Author Commented:
Can some please assist with this.   I am getting short on time!  I wasn't sure if it could be my web config file, or the code for authentication..  

I am geeting this message:

Transaction failed. The server response was: Sending address not accepted due to spam filter
0
meetingexpectationsCommented:
On your SMTP server, can you allow localhost to relay? If not use your smpt account to send emails, allow that smtp server to relay and remove the line 82 in your code above-- smtpClient.Host = "localhost" Don't use this line at all.
0
BOEING39Author Commented:
I deleted line 82.

It appears I cannot use local host.

Placed in SMTP Address

No Joy....
Imports System.Net.Mail

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim con As New System.Data.OleDb.OleDbConnection

        Dim myPath As String
        myPath = Server.MapPath("database2.mdb")

        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
        Dim myCommand As New System.Data.OleDb.OleDbCommand

        myCommand.CommandText = String.Format("INSERT INTO mel([dates],[assigned],[completed],[deferred],[lead],[Ship1],[Log1],[MEL1],[Def1],[Part1],[Ship2],[Log2],[MEL2],[Def2],[Part2],[Ship3],[Log3],[MEL3],[Def3],[Part3],[Ship4],[Log4],[MEL4],[Def4],[Part4],[Ship5],[Log5],[MEL5],[Def5],[Part5],[Ship6],[Log6],[MEL6],[Def6],[Part6],[Ship7],[Log7],[MEL7],[Def7],[Part7],[Ship8],[Log8],[MEL8],[Def8],[Part8]) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}')", DateTime.Parse(Dates.Text), Assigned.Text, Completed.Text, Deferred.Text, Lead.Text, Ship1.Text, Log1.Text, MEL1.Text, Def1.Text, Part1.Text, Ship2.Text, Log2.Text, MEL2.Text, Def2.Text, Part2.Text, Ship3.Text, Log3.Text, MEL3.Text, Def3.Text, Part3.Text, Ship4.Text, Log4.Text, MEL4.Text, Def4.Text, Part4.Text, Ship5.Text, Log5.Text, MEL5.Text, Def5.Text, Part5.Text, Ship6.Text, Log6.Text, MEL6.Text, Def6.Text, Part6.Text, Ship7.Text, Log7.Text, MEL7.Text, Def7.Text, Part7.Text, Ship8.Text, Log8.Text, MEL8.Text, Def8.Text, Part8.Text)
        myCommand.Connection = con
        con.Open()
        myCommand.ExecuteNonQuery()
        con.Close()

        'Send Email
        Dim smtpClient As SmtpClient = New SmtpClient()
        Dim message As MailMessage = New MailMessage()
        Dim fromAddress As MailAddress = New MailAddress("mark@laxpm.com")
        message.From = fromAddress
        message.To.Add("mark@laxpm.com")
        message.Subject = "LAX MEL Form"

        Dim palinBody As String = "Assigned: " & Assigned.Text & ", Completed: " & Completed.Text & ", Deferred: " & Deferred.Text & ", Lead: " & Lead.Text & ", Ship1: " & Ship1.Text & ", Log1: " & Log1.Text & ", MEL1: " & MEL1.Text & ", Def1: " & Def1.Text & ", Part1: " & Part1.Text & ", Ship2: " & Ship2.Text & ", Log2: " & Log2.Text & ", MEL2: " & MEL2.Text & ", Def2: " & Def2.Text & ", Part2: " & Part2.Text & ", Ship3: " & Ship3.Text & ", Log3: " & Log3.Text & ", MEL3: " & MEL3.Text & ", Def3: " & Def3.Text & ", Part3: " & Part3.Text & ", Ship4: " & Ship4.Text & ", Log4: " & Log4.Text & ", MEL4: " & MEL4.Text & ", Def4: " & Def4.Text & ", Part4: " & Part4.Text & ", Ship5: " & Ship5.Text & ", Log5: " & Log5.Text & ", MEL5: " & MEL5.Text & ", Def5: " & Def5.Text & ", Part5: " & Part5.Text & ", Ship6: " & Ship6.Text & ", Log6: " & Log6.Text & ", MEL6: " & MEL6.Text & ", Def6: " & Def6.Text & ", Part6: " & Part6.Text & ", Ship7: " & Ship7.Text & ", Log7: " & Log7.Text & ", MEL7: " & MEL7.Text & ", Def7: " & Def7.Text & ", Part7: " & Part7.Text & ", Ship8: " & Ship8.Text & ", Log8: " & Log8.Text & ", MEL8: " & MEL1.Text & ", Def8: " & Def8.Text & ", Part8: " & Part8.Text & ""



        Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
        Dim htmlBody As String = "<p>Lead: " & Lead.Text & "<br />" _
        '	 + "Date: " & Date.Text & ", "Assigned: " & Assigned.Text & ", "Completed: " & Completed.Text & ", "Defered: " & Deferred.Text & "<br />" _
        '    + "Ship1: " & Ship1.Text & "<br />" _
        '    + "Log1: " & Log1.Text & "<br />" _   
        '    + "MEL1: " & MEL1.Text & "<br />" _
        '    + "Def1: " & Def1.Text & "<br />" _
        '    + "Part1: " & Part1.Text & "<br />" _
        '    + "Ship2: " & Ship2.Text & "<br />" _
        '    + "Log2: " & Log2.Text & "<br />" _   
        '    + "MEL2: " & MEL2.Text & "<br />" _
        '    + "Def2: " & Def2.Text & "<br />" _
        '    + "Part2: " & Part2.Text & "<br />" _
        '    + "Ship3: " & Ship3.Text & "<br />" _
        '    + "Log3: " & Log3.Text & "<br />" _   
        '    + "MEL3: " & MEL3.Text & "<br />" _
        '    + "Def3: " & Def3.Text & "<br />" _
        '    + "Part3: " & Part3.Text & "<br />" _
        '    + "Ship4: " & Ship4.Text & "<br />" _
        '    + "Log4: " & Log4.Text & "<br />" _   
        '    + "MEL4: " & MEL4.Text & "<br />" _
        '    + "Def4: " & Def4.Text & "<br />" _
        '    + "Part4: " & Part4.Text & "<br />" _
        '    + "Ship5: " & Ship5.Text & "<br />" _
        '    + "Log5: " & Log5.Text & "<br />" _   
        '    + "MEL5: " & MEL5.Text & "<br />" _
        '    + "Def5: " & Def5.Text & "<br />" _
        '    + "Part5: " & Part5.Text & "<br />" _
        '    + "Ship6: " & Ship6.Text & "<br />" _
        '    + "Log6: " & Log6.Text & "<br />" _   
        '    + "MEL6: " & MEL6.Text & "<br />" _
        '    + "Def6: " & Def6.Text & "<br />" _
        '    + "Part6: " & Part6.Text & "<br />" _
        '    + "Ship7: " & Ship7.Text & "<br />" _
        '    + "Log7: " & Log7.Text & "<br />" _   
        '    + "MEL7: " & MEL7.Text & "<br />" _
        '    + "Def7: " & Def7.Text & "<br />" _
        '    + "Part7: " & Part7.Text & "<br />" _
        '    + "Ship8: " & Ship8.Text & "<br />" _
        '    + "Log8: " & Log8.Text & "<br />" _   
        '    + "MEL8: " & MEL8.Text & "<br />" _
        '    + "Def8: " & Def8.Text & "<br />" _
        '    + "Part8: " & Part8.Text & "<br />" _

        Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(htmlBody, Nothing, "text/html")
        message.AlternateViews.Add(plainView)
        message.AlternateViews.Add(htmlView)
        message.Priority = MailPriority.High
        smtpClient.Host = "mail.laxpm.com"
        smtpClient.Send(message)

        Response.Redirect("http://delta.laxpm.com")

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Part1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Part1.TextChanged

    End Sub
End Class

Open in new window

0
BOEING39Author Commented:
I loaded files to test area on Web Site and I get the following message. I know there is an issue with "using localhost with Vista".  I also checked and port 25 is not available.  By uploading test file I get
the following::::


Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:


Line 84:             ASP.NET to identify an incoming user.
Line 85:         -->
Line 86:         <authentication mode="Windows" />
Line 87:         <!--
Line 88:             The <customErrors> section enables configuration
 

Source File: d:\wwwsites\laxpmcom\manager\website1\web.config    Line: 86
0
AsishRajCommented:
do you want to send one email to multiple recipients or is every email will have different details for different recipients
0
AsishRajCommented:
refer below for an example

Imports System.Web.Mail
'namespace to be imported

Private Sub btn_SendEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mailMessage As New MailMessage()
'creating an instance of the MailMessage class
mailMessage.From = "someone@domain.com"
'senders email address
mailMessage.To = "a@abc.com;b@universe.com;c@baw.com"
'multiple recipient's
mailMessage.Cc = "carboncopy@domain.com"
'email address of the Cc recipient, if you want to send a copy to some1
mailMessage.Bcc = "blindcarboncopy@domain.com"
'email address of the Bcc recipient, if you want to add a blind copy
mailMessage.Subject = "Hello"
'subject of the email message
mailMessage.BodyFormat = MailFormat.HTML
'HTML message format
mailMessage.Body = "&lthtml>&ltbody>&ltb>&ltu>" & "Your Message body goes here" & "</u></b></body></html>"
'message body, html message
Dim Attach As MailAttachment = New MailAttachment("C:\images\sun.gif")
mailMessage.Attachments.Add(Attach)
'adding an attachment
mailMessage.Priority = MailPriority.Normal
'email priority. Can be low, normal or high
SmtpMail.SmtpServer = "mail.yourserver.com"
'mail server used to send this email. modify this line based on your mail server
SmtpMail.Send(mailMessage)
'using the static method "Send" of the SmtpMail class to send the mail
Response.Write("Mail sent") 
'message stating the mail is sent
End Sub

Open in new window

0
AsishRajCommented:
let me know if something doesnt work out for you
0
BOEING39Author Commented:
I have an ASPNET form that on submit sends data to MS Access data base.  The code is working for
the data base portion, but the e-mail isn't.  The e-mail will be HTML mail with the form data listed.  Yes, it will be going to multiple recipients.    Let me look over what you sent me and I will get back to you.  Thanks for responding.
0
BOEING39Author Commented:
I was attempting to use ASP "System.net.mail".   I suppose I could use "WEB" Mail if the result is the same.   Can you place your code into what I have.  I am not clear on the placement.
Imports System.Net.Mail

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim con As New System.Data.OleDb.OleDbConnection

        Dim myPath As String
        myPath = Server.MapPath("database2.mdb")

        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & myPath & ";"
        Dim myCommand As New System.Data.OleDb.OleDbCommand

        myCommand.CommandText = String.Format("INSERT INTO mel([dates],[assigned],[completed],[deferred],[lead],[Ship1],[Log1],[MEL1],[Def1],[Part1],[Ship2],[Log2],[MEL2],[Def2],[Part2],[Ship3],[Log3],[MEL3],[Def3],[Part3],[Ship4],[Log4],[MEL4],[Def4],[Part4],[Ship5],[Log5],[MEL5],[Def5],[Part5],[Ship6],[Log6],[MEL6],[Def6],[Part6],[Ship7],[Log7],[MEL7],[Def7],[Part7],[Ship8],[Log8],[MEL8],[Def8],[Part8]) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}')", DateTime.Parse(Dates.Text), Assigned.Text, Completed.Text, Deferred.Text, Lead.Text, Ship1.Text, Log1.Text, MEL1.Text, Def1.Text, Part1.Text, Ship2.Text, Log2.Text, MEL2.Text, Def2.Text, Part2.Text, Ship3.Text, Log3.Text, MEL3.Text, Def3.Text, Part3.Text, Ship4.Text, Log4.Text, MEL4.Text, Def4.Text, Part4.Text, Ship5.Text, Log5.Text, MEL5.Text, Def5.Text, Part5.Text, Ship6.Text, Log6.Text, MEL6.Text, Def6.Text, Part6.Text, Ship7.Text, Log7.Text, MEL7.Text, Def7.Text, Part7.Text, Ship8.Text, Log8.Text, MEL8.Text, Def8.Text, Part8.Text)
        myCommand.Connection = con
        con.Open()
        myCommand.ExecuteNonQuery()
        con.Close()

        'Send Email
        Dim smtpClient As SmtpClient = New SmtpClient()
        Dim message As MailMessage = New MailMessage()
        Dim fromAddress As MailAddress = New MailAddress("mark@laxpm.com", "Email Name")
        message.From = fromAddress
        message.To.Add("mark@laxpm.com")
        message.Subject = "LAX MEL Form"

        Dim palinBody As String = "Assigned: " & Assigned.Text & ", Completed: " & Completed.Text & ", Deferred: " & Deferred.Text & ", Lead: " & Lead.Text & ", Ship1: " & Ship1.Text & ", Log1: " & Log1.Text & ", MEL1: " & MEL1.Text & ", Def1: " & Def1.Text & ", Part1: " & Part1.Text & ", Ship2: " & Ship2.Text & ", Log2: " & Log2.Text & ", MEL2: " & MEL2.Text & ", Def2: " & Def2.Text & ", Part2: " & Part2.Text & ", Ship3: " & Ship3.Text & ", Log3: " & Log3.Text & ", MEL3: " & MEL3.Text & ", Def3: " & Def3.Text & ", Part3: " & Part3.Text & ", Ship4: " & Ship4.Text & ", Log4: " & Log4.Text & ", MEL4: " & MEL4.Text & ", Def4: " & Def4.Text & ", Part4: " & Part4.Text & ", Ship5: " & Ship5.Text & ", Log5: " & Log5.Text & ", MEL5: " & MEL5.Text & ", Def5: " & Def5.Text & ", Part5: " & Part5.Text & ", Ship6: " & Ship6.Text & ", Log6: " & Log6.Text & ", MEL6: " & MEL6.Text & ", Def6: " & Def6.Text & ", Part6: " & Part6.Text & ", Ship7: " & Ship7.Text & ", Log7: " & Log7.Text & ", MEL7: " & MEL7.Text & ", Def7: " & Def7.Text & ", Part7: " & Part7.Text & ", Ship8: " & Ship8.Text & ", Log8: " & Log8.Text & ", MEL8: " & MEL1.Text & ", Def8: " & Def8.Text & ", Part8: " & Part8.Text & ""



        Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
        Dim htmlBody As String = "<p>Lead: " & Lead.Text & "<br />" _
        '	 + "Date: " & Date.Text & ", "Assigned: " & Assigned.Text & ", "Completed: " & Completed.Text & ", "Defered: " & Deferred.Text & "<br />" _
        '    + "Ship1: " & Ship1.Text & "<br />" _
        '    + "Log1: " & Log1.Text & "<br />" _   
        '    + "MEL1: " & MEL1.Text & "<br />" _
        '    + "Def1: " & Def1.Text & "<br />" _
        '    + "Part1: " & Part1.Text & "<br />" _
        '    + "Ship2: " & Ship2.Text & "<br />" _
        '    + "Log2: " & Log2.Text & "<br />" _   
        '    + "MEL2: " & MEL2.Text & "<br />" _
        '    + "Def2: " & Def2.Text & "<br />" _
        '    + "Part2: " & Part2.Text & "<br />" _
        '    + "Ship3: " & Ship3.Text & "<br />" _
        '    + "Log3: " & Log3.Text & "<br />" _   
        '    + "MEL3: " & MEL3.Text & "<br />" _
        '    + "Def3: " & Def3.Text & "<br />" _
        '    + "Part3: " & Part3.Text & "<br />" _
        '    + "Ship4: " & Ship4.Text & "<br />" _
        '    + "Log4: " & Log4.Text & "<br />" _   
        '    + "MEL4: " & MEL4.Text & "<br />" _
        '    + "Def4: " & Def4.Text & "<br />" _
        '    + "Part4: " & Part4.Text & "<br />" _
        '    + "Ship5: " & Ship5.Text & "<br />" _
        '    + "Log5: " & Log5.Text & "<br />" _   
        '    + "MEL5: " & MEL5.Text & "<br />" _
        '    + "Def5: " & Def5.Text & "<br />" _
        '    + "Part5: " & Part5.Text & "<br />" _
        '    + "Ship6: " & Ship6.Text & "<br />" _
        '    + "Log6: " & Log6.Text & "<br />" _   
        '    + "MEL6: " & MEL6.Text & "<br />" _
        '    + "Def6: " & Def6.Text & "<br />" _
        '    + "Part6: " & Part6.Text & "<br />" _
        '    + "Ship7: " & Ship7.Text & "<br />" _
        '    + "Log7: " & Log7.Text & "<br />" _   
        '    + "MEL7: " & MEL7.Text & "<br />" _
        '    + "Def7: " & Def7.Text & "<br />" _
        '    + "Part7: " & Part7.Text & "<br />" _
        '    + "Ship8: " & Ship8.Text & "<br />" _
        '    + "Log8: " & Log8.Text & "<br />" _   
        '    + "MEL8: " & MEL8.Text & "<br />" _
        '    + "Def8: " & Def8.Text & "<br />" _
        '    + "Part8: " & Part8.Text & "<br />" _

        Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(htmlBody, Nothing, "text/html")
        message.AlternateViews.Add(plainView)
        message.AlternateViews.Add(htmlView)
        message.Priority = Mail.laxpm.com.High
        smtpClient.Host = "localhost"
        smtpClient.Send(message)

        Response.Redirect("http://delta.laxpm.com")

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
End Class

Open in new window

0
BOEING39Author Commented:
Thw Web Mail format is obsolete.  Need to use "System.net.Mail"
0
BOEING39Author Commented:
Ok, the following code is not submitting to e-mail and the data base.   When I get the email the only text showing up is  for the following section of code:

im plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
        Dim htmlBody As String = "<p>Lead: " & Lead.Text & "<br />"

The Lead text appears in my e-mail but the rest of the data for the attached code isn't.  All I need now is the correct formatting for the VB code for the remainder of text boxes on the form.
 Dim plainView As AlternateView = AlternateView.CreateAlternateViewFromString(palinBody, Nothing, "text/plain")
        Dim htmlBody As String = "<p>Lead: " & Lead.Text & "<br />" _
        '	 + "Date: " & Date.Text & ", "Assigned: " & Assigned.Text & ", "Completed: " & Completed.Text & ", "Defered: " & Deferred.Text & "<br />" _
        '    + "Ship1: " & Ship1.Text & "<br />" _
        '    + "Log1: " & Log1.Text & "<br />" _   
        '    + "MEL1: " & MEL1.Text & "<br />" _
        '    + "Def1: " & Def1.Text & "<br />" _
        '    + "Part1: " & Part1.Text & "<br />" _
        '    + "Ship2: " & Ship2.Text & "<br />" _
        '    + "Log2: " & Log2.Text & "<br />" _   
        '    + "MEL2: " & MEL2.Text & "<br />" _
        '    + "Def2: " & Def2.Text & "<br />" _
        '    + "Part2: " & Part2.Text & "<br />" _
        '    + "Ship3: " & Ship3.Text & "<br />" _
        '    + "Log3: " & Log3.Text & "<br />" _   
        '    + "MEL3: " & MEL3.Text & "<br />" _
        '    + "Def3: " & Def3.Text & "<br />" _
        '    + "Part3: " & Part3.Text & "<br />" _
        '    + "Ship4: " & Ship4.Text & "<br />" _
        '    + "Log4: " & Log4.Text & "<br />" _   
        '    + "MEL4: " & MEL4.Text & "<br />" _
        '    + "Def4: " & Def4.Text & "<br />" _
        '    + "Part4: " & Part4.Text & "<br />" _
        '    + "Ship5: " & Ship5.Text & "<br />" _
        '    + "Log5: " & Log5.Text & "<br />" _   
        '    + "MEL5: " & MEL5.Text & "<br />" _
        '    + "Def5: " & Def5.Text & "<br />" _
        '    + "Part5: " & Part5.Text & "<br />" _
        '    + "Ship6: " & Ship6.Text & "<br />" _
        '    + "Log6: " & Log6.Text & "<br />" _   
        '    + "MEL6: " & MEL6.Text & "<br />" _
        '    + "Def6: " & Def6.Text & "<br />" _
        '    + "Part6: " & Part6.Text & "<br />" _
        '    + "Ship7: " & Ship7.Text & "<br />" _
        '    + "Log7: " & Log7.Text & "<br />" _   
        '    + "MEL7: " & MEL7.Text & "<br />" _
        '    + "Def7: " & Def7.Text & "<br />" _
        '    + "Part7: " & Part7.Text & "<br />" _
        '    + "Ship8: " & Ship8.Text & "<br />" _
        '    + "Log8: " & Log8.Text & "<br />" _   
        '    + "MEL8: " & MEL8.Text & "<br />" _
        '    + "Def8: " & Def8.Text & "<br />" _
        '    + "Part8: " & Part8.Text & "<br />" _

        Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(htmlBody, Nothing, "text/html")
        message.AlternateViews.Add(plainView)
        message.AlternateViews.Add(htmlView)
        message.Priority = MailPriority.High
        smtpClient.Host = "mail.laxpm.com"
        smtpClient.Send(message)

Open in new window

0
BOEING39Author Commented:
Please close question.  I figured it out.  Issues with Web Config file and namespace.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.