Solved

multiple lines in text body

Posted on 2004-10-07
5
2,798 Views
Last Modified: 2007-12-19
I am trying to send a message using CDO, I receive the password but not the alias,
here is my code :-

Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To             = "Email"
oMail.From       = "me@here.com"
oMail.Subject       = "Welcome to our member section!"
oMail.TextBody       = "Your Password is: " & PasswordTemp  & vbCrLf
oMail.TextBody           = "Your Alias is: " & user  & vbCrLf

oMail.Send
Set iConf = Nothing
Set Flds = Nothing

appreciate any help
0
Comment
Question by:kajamy
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Barry62
Comment Utility
Well, if you are getting the password back, then CDO is working fine.  I think you need to show more of your script.  Where do you populate the 'user' variable?

Barry62
0
 

Author Comment

by:kajamy
Comment Utility
This is my script :-

useraction = request("action")
select case useraction
case "login"
'generate the function
PasswordTemp = rndit()
'collect data from form
Alias = request.form("Alias")
Email = request.form("Email")
Age = request.form("Age")
'response.write Alias & Email & Age & rndit'***debug
'database objects
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
'sql query
sql = "select Password from users where Password='"&PasswordTemp&"' or Alias='"& Alias & "' or Age='"& Age & "'"
Conn.Open dsn
rs.open sql,conn
if rs.eof and rs.bof then
sql1 = "insert into users (Alias,Password,Age,Email) values('"& Alias & "',"& PasswordTemp & ",'"& Age & "', '"& Email & "')"
conn.execute(sql1)
response.write "<script>alert('you registered succefully');location.href='index.asp';</script>"


       
Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To             = "Email"
oMail.From             = "me@here.com"
oMail.Subject       = "Welcome to our member section!"
oMail.TextBody       = "Your Alias is: " & Alias  & vbCrLf
oMail.TextBody  = "Your Password is: " & PasswordTemp  & vbCrLf

oMail.Send
Set iConf = Nothing
Set Flds = Nothing

            else
response.write "<script>alert('Alias already exists');</script>"
                  
            end if
            
rs.close
set rs = nothing
conn.close
set conn = nothing

end select
%>      

0
 
LVL 8

Accepted Solution

by:
Barry62 earned 50 total points
Comment Utility
Ah, I should have seen it before!

you have:

oMail.TextBody      = "Your Alias is: " & Alias  & vbCrLf
oMail.TextBody  = "Your Password is: " & PasswordTemp  & vbCrLf


You are redefining oMail.TextBody.  What you need is this:

oMail.TextBody      = "Your Alias is: " & Alias  & vbCrLf
oMail.TextBody  = oMail.TextBody & "<br><br>Your Password is: " & PasswordTemp  & vbCrLf


Barry62
0
 

Author Comment

by:kajamy
Comment Utility
Cool tried that the message now reads :-

Your Alias is:
Your Password is: 500118

I  removed the <br> as they are not necessary.

any idea why the password doesn't show up?
0
 

Author Comment

by:kajamy
Comment Utility
Ok tried it in reverse and got :-

Your Password is: 953701
Your Alias is:

so it's my variables that are wrong
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now