Question

How do i pass a hostname and port 25 into this 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>
Était-ce utile?

La solution

You can configure e-mail sending options via the Configuration.Fields property of the CDO.Message object:

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top