There are several email components out there. ASP's default email component is CDONTS, which you can use if you have an SMTP server up and running on your web server. Otherwise, you'll need to grab a third party component that allows you to specify your mail server, such as persit's free component, aspEmail, which you can obtain at
Ive got it installed but how do I link it to my page so that as soon as a record(post) gets updated that it sends the email do i have to link it to mysql somehowe with com compnents?
To send an email, you can use the following code (copy and paste job from their website)
<%
Set Mail = Server.CreateObject("Persits.MailSender"
Mail.Host = "smtp.smtp-server.com" ' Specify a valid SMTP server
Mail.From = "sales@veryhotcakes.com" ' Specify sender's address
Mail.FromName = "VeryHotCakes Sales" ' Specify sender's name
Mail.AddAddress "andy@andrewscompany.net", "Andrew Johnson, Jr."
Mail.AddAddress "paul@paulscompany.com" ' Name is optional
Mail.AddReplyTo "info@veryhotcakes.com"
Mail.AddAttachment "c:\images\cakes.gif"
Mail.Subject = "Thanks for ordering our hot cakes!"
Mail.Body = "Dear Sir:" & Chr(13) & Chr(10) & _
"Thank you for your business."
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
End If
%>
You can put whatever you like into the body, of course... possibly some pertinent information about the record you just updated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.