Solved

need form mail for asp site (NT)

Posted on 2013-05-22
4
453 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 53

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 53

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

728 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