Skip to main content
October 2, 2009
Question

sendmail.asp hell...

  • October 2, 2009
  • 1 reply
  • 578 views

Hi, I cannot get this sendmail.asp files script to work...

<%
smtpServer = "intmail"
smtpPort = 25
dim smtpServer, smtpPort
Set message = CreateObject ("JMail.Message")
message.From = Request.Form("fromEmail")
message.FromName = Request.Form("fromName")
message.Subject = "Flash Movie Feedback"
message.AddRecipient "enquires@pizzapal.co.uk", "mark poole"
message.ContentType = "text/html" '
message.ISOEncodeHeaders = false
message.ContentTransferEncoding = "8bit"
message.Body = Request.Form("body")
message.Priority = 3
message.Send(smtpServer & ":" & smtpPort)
Response.write "success=1&timeDate=" & Server.URLEncode(message.Date) & "&end=1"
set message = nothing
%>

There is an attchment as well. Can anyone please help?

This topic has been closed for replies.

1 reply

Participating Frequently
October 2, 2009

Not work, as in??? Error message, blank email, no email sent?

Is Jmail installed on the server?'

You are assigning values to smtpServer and smtpPort before declaring them

October 2, 2009

Not work, as in??? Error message, blank email, no email sent?

Page message "Sorry the server is down" and no email is recieved.

Is Jmail installed on the server?

Yes

You are assigning values to smtpServer and smtpPort before declaring them.

Please explain further...

Participating Frequently
October 2, 2009

>Page message "Sorry the server is down" and no email is recieved.

What line is this occuring on?

Also, is 'intmail' the correct smtp server? Seems a bit strange.

>You are assigning values to smtpServer

>and smtpPort before declaring them.

>Please explain further...

It's pretty self explanatory. You are using the variables before you have actually dimensioned them. In ASP/VBScript it probably doesn't matter. But as a matter of convention you should dimension before using variables.