Email Name

Results 1 to 3 of 3

Thread: Email Name

  1. #1
    Ryder Guest

    Default Email Name

    I have the following line of code and I can t seem to get it to put the members first name in the message body, the code takes the members email when he/she signs up and send them a welcome email, how dod I include their first name in the message body?<BR><BR>here is the code:<BR>Email = request.form("Email")<BR>FirstName = request.form("FirstName")<BR> &#039;chooses username and password from database that correspond to submitted email address.<BR>first = request.form("FirstName")<BR>last = request.form("LastName")<BR>user = request.form("Username")<BR>pass = request.form("Password")<BR>Set sendmail = Server.CreateObject("CDONTS.NewMail")<BR> &#039;put the webmaster address here<BR>sendmail.From = ""<BR> &#039;The mail is sent to the address entered in the previous page.<BR>sendmail.To = request.form("Email")<BR> &#039;Enter the subject of your mail here<BR>sendmail.Subject = "Welcome to BlueMist Online"<BR> &#039;This is the content of thr message.<BR>sendmail.Body = "Welcome, to BlueMist Online. Here is Your Account Information." & vbCrlf & vbCrlf _<BR>& "Username=" & user & vbCrlf _<BR>& "Password=" & pass & vbCrlf<BR> &#039;this sets mail priority.... 0=low 1=normal 2=high<BR>sendmail.Importance = 2<BR>sendmail.Send<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Email Name

    You have an comment in the code that says:<BR><BR>&#039;chooses username and password from database that correspond to <BR>submitted email address.<BR><BR>and then you do <BR><BR>user = request.form("Username")<BR><BR>This is not coming from an database but from the form! *if* you want to get the name from the database you should make an select to the db.<BR><BR>(something like:<BR><BR>set rs = objConn.execute ("SELECT username FROM users WHERE email = &#039;" & request.form("email") & "&#039;")<BR><BR>(kinda assuming you know how to make an connection to an db and how to work with recordsets)<BR><BR>Peter<BR>

  3. #3
    VBGuy Guest

    Default RE: Email Name

    I don&#039;t understand what&#039;s so hard about this. Why can&#039;t you use the same syntax you used for username and password?<BR><BR>***sendmail.Body = "Welcome, to BlueMist Online, " & first & "!" & _<BR>***" Here is Your Account Information." & [etc., etc.]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts