Solved

need form mail for asp site (NT)

Posted on 2013-05-22
4
448 Views
Last Modified: 2013-05-23
hi - I just transferred a website from one host to another. Its a windows based site using .asp files.  I need to get the form mail to work. Last provider had ASPMail component, this new host does not have any component and email is with a third party host - I have a plesk control web panel. anyone know how i can get form mail to work here?

using a test script i found online here:
http://www.brainjar.com/asp/formmail/
but unable to get that to work. Any advise would be great!
0
Comment
Question by:WebGirlCrissy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39189752
You just need to use cdo.  This is a great resource.  http://www.paulsadowski.com/wsh/cdo.htm

You can start with this

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "yea mail"
objMessage.From = "me@my.com"
objMessage.To = "test@mydomain.com"
' objMessage.TextBody = "This is some sample message text."
objMessage.HTMLBody = "<h1>This is some sample message html.</h1>"
objMessage.Send

If you are on a shared host, chances are this might work.  If you need to use a remote smtp or authorize with a password check out the example, "Sending a text email using authentication against a remote SMTP server."

You might have to do a few trial and errors to get the correct settings.  I would try the simple version first.  If that does not work, you can try and ask your web host which settings will work for cdo email.  If you are using a remote smtp service then you could probably just use the given sample for remote but make sure you have the username, password, host, and port set.
0
 

Author Comment

by:WebGirlCrissy
ID: 39191969
that worked like a charm! thank you!
0
 

Author Closing Comment

by:WebGirlCrissy
ID: 39191973
thank you!
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39192029
Great.  

In order to make this easy for me on multiple pages I keep this code on a separate page as a function and add it as an in include file on any page I need to send mail.

function SendMail(from,to,subject,body)

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = subject
objMessage.From = from
objMessage.To = to
' objMessage.TextBody = "This is some sample message text." 
objMessage.HTMLBody = body
objMessage.Send 

end function

Open in new window


Sometimes  I get really fancy and have a separate template file where I keep things like the header, footer, background etc that is also in a separate include file.
function template(body)
html="<table><tr><td>header</td></tr>"
html=html&"<table><tr><td>"&body&"</td></tr>"
html=html&"<table><tr><td>footer</td></tr>"
template=html
end function

function SendMail(from,to,subject,body)

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = subject
objMessage.From = from
objMessage.To = to
' objMessage.TextBody = "This is some sample message text." 
objMessage.HTMLBody = template(body)
objMessage.Send 

end function

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question