0

ホスト名とポート25をこのvbscriptに渡すにはどうすればよいですか?

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<%
if request("Name") ="" or request("Email") ="" or request("Address") ="" then 
response.redirect("catalogue_error.html")
end if


Subject="Enquiry from test test"
BodyText=" <div id='textareazzz' style='font-family:arial'> <br>"
BodyText=BodyText+"<strong>Line of Business:</strong>"&request("Line of Business")&"<br>"
BodyText=BodyText+"<strong>Name:</strong>"&request("Name")&"<br>"
BodyText=BodyText+"<strong>Company:</strong>"&request("Company")&"<br>"
BodyText=BodyText+"<strong>Address:</strong>"&request("Address")&"<br>"
BodyText=BodyText+"<strong>Post Code:</strong>"&request("Post Code")&"<br>"
BodyText=BodyText+"<strong>Contact Tel No:</strong>"&request("Contact Tel No")&"<br>"
BodyText=BodyText+"<strong>Email:</strong>"&request("Email")&"<br>"
BodyText=BodyText+"</div>"
Response.write(BodyText)


Dim objMessage
Set objMessage = Server.CreateObject("CDO.Message")

With objMessage
.To = "test@hotmail.co.uk"
'.To = "test@hotmail.co.uk"
.From = "test@test.co.uk"
.Subject = Subject
.HTMLBody = BodyText
.Send
End With

Set objMessage = Nothing
response.redirect("cdo.html")
%>
<body>
<%=request("From")%><br>
<%=request("Subject")%><br>
<%=request("Message")%><br>
</body>

</html>
4

1 に答える 1

1

オブジェクトのConfiguration.Fieldsプロパティを使用して、電子メール送信オプションを構成できます。CDO.Message

objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' cdoSendUsingPort
objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "server"
objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
于 2012-06-01T13:43:07.860 に答える