Fjern ikke udfyldte felter i mail
HejJeg har en form der ser således ud, og jeg vil gerne have fjernet de felter der IKKE er udfyldt i formen - i mailen der bliver sendt, er der nogen der har en løsning på det.
<form METHOD="POST" action="test.asp" onsubmit="return FrontPage_Form1_Validator(this)">
<table border="1" width="560" cellspacing="0" height="400" cellpadding="5"
bgcolor="#E6E6E6" bordercolor="#FFFFFF">
<tr>
<td ALIGN="right" width="167" valign="top" height="30"><div align="left"><p></td>
<td valign="top" width="331" height="30"><input type="text" name="test1" size="20"></td>
</tr>
<tr>
<td ALIGN="right" width="167" valign="top" height="61"></td>
<td valign="top" width="331" height="61"><input type="text" name="test2" size="20"></td>
</tr>
<tr>
<td ALIGN="left" width="167" height="23"></td>
<td width="331" height="23"><input type="text" name="test3" size="20"><p><input
TYPE="submit" VALUE="Send" name="Send"></td>
</tr>
</table>
</form>
og test.asp:
<%
Dim myMail
Dim HTML
Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<meta name=""GENERATOR"""
HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
HTML = HTML & "<title>HTMLMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"""
HTML = HTML & "<p><font size =""2"" face=""Arial"">"
HTML = HTML & "test1"
HTML = HTML & "<strong>"
HTML = HTML & request.form("test1")
HTML = HTML & "</strong>"
HTML = HTML & "<br>Printet"
HTML = HTML & "<strong>"
HTML = HTML & request.form("test2")
HTML = HTML & "</strong>"
HTML = HTML & "</table> "
HTML = HTML & "<br> an HTML page<br>"
HTML = HTML & "which allows you to send rich text and"
HTML = HTML & "inline graphics.</p> "
HTML = HTML & "</table>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
myMail.From=""
myMail.To= ""
myMail.CC="test@mail.dk"
myMail.Subject="aftale " & "nr. " & request.form("test1") & " Aktivitet " & request.form("test2")
myMail.BodyFormat=0
myMail.MailFormat=0
myMail.Body=HTML
myMail.Send
set mymail=nothing
Response.Write "Message Sent"
%>
