Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Generate Email 1

Status
Not open for further replies.

jeevenze

Technical User
Mar 13, 2001
62
US
I've essentially built an online messaging system. I'm using ultradev and have built the database in access. What I'm looking for is a script that when a user submits a message, I can get an automatic email notifying me that a message has been submited. I'd really appreciate it if someone could point me in the right direction or give me pointers on how to write this script.

Thank you in advance to anyone who helps me. >:):O>
 
I use CDONTS and it works fine for me. For example, this is a script that I use to mail a password reminder to a user that has forgotten login details:

Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")

' This code assumes the above CDO instantiation code is included
objCDO.To = email
objCDO.From = "pwadmin@mycompany.com ( Password Reminder)"
objCDO.bcc = "me@mycompany.com"
objCDO.Mailformat=0 ' Specifies HTML Message Format
objCDO.Bodyformat=0 ' Specifies HTML Message Format

Dim MailBody

MailBody = &quot;<!DOCTYPE HTML PUBLIC &quot;&quot;-//W3C//DTD W3 HTML//EN&quot;&quot;>&quot;
MailBody = MailBody & &quot;<HTML>&quot; & vbcrlf
MailBody = MailBody & &quot;<HEAD><TITLE>Password Reminder</TITLE></HEAD>&quot;
MailBody = MailBody & &quot;<BODY>&quot; & vbcrlf
MailBody = MailBody & &quot;Dear &quot; & record.Fields(&quot;UserName&quot;) & &quot;,<BR><BR>&quot;
MailBody = MailBody & &quot;Your login details for the client area are as follows:<BR><BR>&quot;
MailBody = MailBody & vbcrlf
MailBody = MailBody & &quot;<TABLE BORDER=&quot;&quot;0&quot;&quot; CELLSPACING=&quot;&quot;2&quot;&quot;>&quot;
MailBody = MailBody & &quot;<TR><TD><B>User ID:</B></TD><TD>&quot; & record.Fields(&quot;UserID&quot;) & &quot;</TD></TR>&quot;
MailBody = MailBody & &quot;<TR><TD><B>Password:</B></TD><TD>&quot; & record.Fields(&quot;Password&quot;) & &quot;</TD></TR>&quot;
MailBody = MailBody & &quot;</TABLE></BODY></HTML>&quot;

objCDO.Subject = &quot;Login Details.&quot;
objCDO.Body = MailBody
objCDO.Send

Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top