Ask a Question related to Dreamweaver AppDev, Design and Development.
-
jsteinmann #1
CDOSYS - IF NOT A VALID EMAIL
with the cdosys script i have, it works fine if you have a dim email that is an
email address, but if a user were to leave that field blank, or not enter a
valid email format, they will get an error if left blank: CDO.Message.1 error
'8004020c' At least one recipient is required, but none were found. if
something non email was entered (like 'abc123'): error '8004020f' i need to be
able to have the script not run and/or cause an error, if the informaiton
submitted is missing or incorrect (and no form check suggestions please) Here
is the code: <% If (CStr(Request('MM_insert')) <> '') Then Set usxMsg =
CreateObject('CDO.Message') Set usxConf = CreateObject('CDO.Configuration')
Dim email email=Request.Form('email') ' Set the SMTP Server Set Flds =
usxConf.Fields With Flds ' Port
'.Item('http://schemas.microsoft.com/cdo/configuration/smtpserverport') = 25
..Item('http://schemas.microsoft.com/cdo/configuration/smtpauthenticate') = 1
..Item('http://schemas.microsoft.com/cdo/configuration/sendusername') =
'jsteinmann'
..Item('http://schemas.microsoft.com/cdo/configuration/sendpassword') =
'password' .Item('http://schemas.microsoft.com/cdo/configuration/sendusing') =
2 .Item('http://schemas.microsoft.com/cdo/configuration/smtpserver') =
'mail.site.com' 'SSL
'.Item('http://schemas.microsoft.com/cdo/configuration/smtpusessl') = False
'timeout in seconds
'.Item('http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout')
= 10 .Update End With With usxMsg Set .Configuration = usxConf .To = email
..From = 'site <address@site.com>' .Subject = 'subject' .HTMLBody = 'body'
..Fields.Update .Send End With Set Flds = Nothing Set usxMsg = Nothing Set
usxConf = Nothing end if %>
jsteinmann Guest
-
Email Scripts, CDOSYS, and Security
I am a newbie with Dreamweaver and with ASP.NET. I created a form where the data is submitted to a SQL database and an email is sent notifying the... -
CDOSYS and smarthost
I'm trying to send an email from my ASP page using CDO.Message and CDO.Configuration. I couldn't get this to work for ages and all my emails ended... -
Email::Valid cannot find itself when doing a make test.
Anybody know how to get Email::Valid to locate itself so that valid.t will not fail because it cannot find the Email::Valid module? -
copy Attachement from Email on server (files copied are not valid)
Hi, I'm getting emails from an address trough a script and I want to copy the attached files on the server. I can get the files and copy them on... -
asp/cdosys generated email using SMTP
Show Code -- ---------------------------------------------------------- Curt Christianson (Software_AT_Darkfalz.Com) Owner/Lead Designer,... -
RobGT #2
Re: CDOSYS - IF NOT A VALID EMAIL
You would need to run a validation script on the email address when they
enter it to check it is correctly constructed - bear in mind that these
scripts are not perfect - i.e. you can't stop someone entering
[email]notreal@qwerty.com[/email] for example as the scripts only check that the three
email elements are in place (the bit before the @ - the bit between the @
and the top level domain extension, and finally the TLD extension.
With that in mind, if you wrap the piece of code that sends the email in an
IF statement to check that an email address was supplied then you will at
least stop the script from reporting an error on the page to the user.
HTH
Rob
[url]http://robgt.com[/url]
RobGT Guest
-
jsteinmann #3
Re: CDOSYS - IF NOT A VALID EMAIL
can you show me an example of what thay would look like (wrapping the actual
sending of an email in an if then statement)? basically, i'm not worried about
bogus or missing entries (which i realize i can force with a yy_check form) at
this point, i'm just worried about the user getting an error. With that in
mind, if you wrap the piece of code that sends the email in an IF statement to
check that an email address was supplied then you will at least stop the
script from reporting an error on the page to the user. HTH Rob
[url]http://robgt.com[/url]
jsteinmann Guest
-
jsteinmann #4
Re: CDOSYS - IF NOT A VALID EMAIL
Rob, if i add something like: if Request.Form('email') <> '' then above the
dim, i can prevent the problem of a blank form causing the missing information
error, but how do i wrap this so that the elements of an email must be present
to perform the action without the use of a check_form script for the form
itself?
jsteinmann Guest
-
CMBergin #5
Re: CDOSYS - IF NOT A VALID EMAIL
If Request.Form("Email") <> "" Then
'Your CDO code goes here
Else
'Do whatever you want to indicate to the user there was an error, or
simply redirect to the next page if you don't care
End If
"jsteinmann" <webforumsuser@macromedia.com> wrote in message
news:cvusio$jee$1@forums.macromedia.com...actual> can you show me an example of what thay would look like (wrapping theabout> sending of an email in an if then statement)? basically, i'm not worriedform) at> bogus or missing entries (which i realize i can force with a yy_checkthat in> this point, i'm just worried about the user getting an error. Withstatement to> mind, if you wrap the piece of code that sends the email in an IF> check that an email address was supplied then you will at least stop the
> script from reporting an error on the page to the user. HTH Rob
> [url]http://robgt.com[/url]
>
CMBergin Guest
-
RobGT #6
Re: CDOSYS - IF NOT A VALID EMAIL
Hi,
You would do this as per CMBergins post.
Cheers,
Rob
RobGT Guest



Reply With Quote

