See anything wrong with this?

Results 1 to 4 of 4

Thread: See anything wrong with this?

  1. #1
    Join Date
    Dec 1969

    Default See anything wrong with this?

    Does anyone see anything wrong with this code?<BR><BR>&#060;%@Language=VBScript%&#062;<BR>& #060;%Option Explicit%&#062;<BR>&#060;%<BR>Dim objNewMail<BR>Set objNewMail = Server.CreateObject("CDONTS.NewMail")<BR>objNewMai l.To = ""<BR>objNewMail.From = Request.Form("name") & " [" & Request.Form("email") & "]"<BR>objNewMail.Subject = "Response from the Soundings web site."<BR>objNewMail.Body = Request.Form("comments")<BR>objNewMail.Send<BR>set objNewMail = Nothing<BR>Response.Redirect("")<BR>%&#062;<BR><BR>As you can tell, some of the properties are pulled from a form that submits to this asp. My server administrator assures me that everything is honky dory on the server side (as far as CDO is concerned). Yet it does not send the mail.

  2. #2
    Sathiya Guest

    Default RE: See anything wrong with this?

    In the server their will be a SMTP directory or Mail directory where the mail resides if it is not mailed. If it is their then ur code is correct. IF not something wrong with ur code. Check the From in ur code. If the from value is blank it will not send mail.

  3. #3
    Join Date
    Dec 1969

    Default RE: See anything wrong with this?

    I dont really see anything wrong, it might take a while to send out the email! Try adding error checking like this:<BR><BR>On Error Resume Next<BR>objNewMail.From = email<BR>DisplayError Err.number, Err.Description, "objNewMail.From status"<BR><BR>On Error Resume Next<BR>objNewMail.To = emailto<BR>DisplayError Err.number, Err.Description, "objNewMail.To status"<BR>Sub DisplayError(intError, strError, strMessage)<BR><BR> Dim strNewLine<BR> strNewLine = "<BR>"<BR><BR> Response.Write strMessage & " = " & intError<BR> If intError &#060;&#062; 0 Then Response.Write " (" & strError & ")"<BR> Response.Write strNewLine<BR><BR>End Sub<BR><BR>that is my code that I got to work, I just assigned the Request.Form(" ") stuff to a variable earlier then assigned it. But yours will work too, it might be the "From" that is messing things up, hardcode a default value to just try and get the email to send ie from=""

  4. #4
    lorddog Guest

    Default RE: See anything wrong with this?

    dont you have to have &#060;%Option Explicit%&#062; as the first command<BR>and not the script tag.

Posting Permissions

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