Solved

multiple lines in text body

Posted on 2004-10-07
5
2,964 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
[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
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Barry62
ID: 12248300
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
ID: 12250194
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
ID: 12250328
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
ID: 12250822
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
ID: 12250882
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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