Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 EMail Issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 26 September 2015 :  18:06:54  Show Profile  Reply with Quote
Here's an excerpt from a program. Using the same "inc_mail.asp" which the forum uses (successfully) and the same server and email addresses, for some reason this won't send the mail. Any ideas?


Dim Err_Msg, strFrom, strFromName, strMailServer, strMailMode, strRecipients, strRecipientsName, strSender, strSubject, strMessage
Err_Msg = "" : strMailServer = "(server address is here)" : strRecipients = "(email address is here)"
strFrom = strRecipients
strFromName = "Craig"
strRecipientsName = "Craig"
strSender = strRecipients
strSubject = "New Comment"
strMessage = "A new comment requiring approval was posted on " & Now() & vbNewLine & vbNewLine
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%

huwsnitz
Starting Member

United Kingdom
5 Posts

Posted - 27 September 2015 :  06:41:29  Show Profile  Visit huwsnitz's Homepage  Reply with Quote
could for any of lots of reasons I'm afraid.
Are you trying to run the script on the same server as the working forum that sends mail successfully?
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 September 2015 :  07:59:01  Show Profile  Reply with Quote
Yes. Same server, same site.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 September 2015 :  15:32:30  Show Profile  Visit Webbo's Homepage  Reply with Quote
Does the server require authentication for emails sent via smtp and as the script isn't giving the authentication details it is functioning but not sending?
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 September 2015 :  15:43:06  Show Profile  Reply with Quote
Nope, that's not it. The same include is used for both, functions from the forum, as is.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 28 September 2015 :  13:03:53  Show Profile  Visit HuwR's Homepage  Reply with Quote
do you use a local mail server? would need to see mail server logs to determine if it got the email and what it did with it

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 28 September 2015 :  16:53:13  Show Profile  Reply with Quote
Just a quick question, given that the page that you are using is outside of the Snitz Forum software from what you wrote, how does it know which mail component to use from the inc_mail.asp file to send mail? Or is it in the bounds of the forum software?


Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 28 September 2015 :  20:27:07  Show Profile  Reply with Quote
@HuwR - No, it's on a hosted server. No access to the logs.

@Classic - the mail component is specified at the top of the include. That's the only change to the file. I also tested it by embedding the case procedure (see below) directly into this file, no change.


			Dim Err_Msg, strFrom, strFromName, strMailServer, strMailMode, strRecipients, strRecipientsName, strSender, strSubject, strMessage
			Err_Msg = "" : strMailServer = "(server address is here)" : strRecipients = "(email address is here)"
			strFrom = strRecipients
			strFromName = "Craig"
			strRecipientsName = "Craig"
			strSender = strRecipients
			strSubject = "New Comment"
			strMessage = "A new comment requiring approval was posted on " & Now() & vbNewLine & vbNewLine
			Set iConf = Server.CreateObject ("CDO.Configuration")
			Set Flds = iConf.Fields
			Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
			Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailServer
			Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
			Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""
			Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
			Flds.Update
			Set objNewMail = Server.CreateObject("CDO.Message")
			Set objNewMail.Configuration = iConf
			Err.Clear
			objNewMail.To = strRecipients
			objNewMail.From = strSender
			objNewMail.Subject = strSubject
			objNewMail.TextBody = strMessage
			objNewMail.Send
			On Error Resume Next
			If Err <> 0 Then
				Response.Write	"<p align=""center""><font color=""white""><ul><li>Your request was not sent due to the following error: " & Err.Description & "</li></ul></font></p></body></html>"
				Response.End
			Else
				Response.Redirect	"sign.asp"
			End If


Found the issue. On another server, it works just fine. There's apparently a mail back-log or denial of service going on at test site.

Edited by - Carefree on 28 September 2015 21:35:04
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07