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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Mail Configuration
 CDOSYS mail config issues
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

snowbird30ds
Starting Member

United Kingdom
33 Posts

Posted - 12 October 2020 :  14:41:57  Show Profile  Reply with Quote
I can't get aspmail to work anymore with ionos servers so been trying cdosys, I have successfully used the following test script but just can't get snitz to play ball, what do I need to add to inc_mail.asp?
<%
CONST SMTPSendUsing = 2 ' Send using Port (SMTP over the network)
CONST SMTPServer = "smtp.ionos.co.uk"
CONST SMTPServerPort = 587
CONST SMTPConnectionTimeout = 10 'seconds
CONST SMTPUser = "xxxxxxxx@xxxxxxx.co.uk"
CONST SMTPPassword = "xxxxXXXxxxx"

dim sSubject, sEmail, sMailBody, sFrom, sReadReceipt, sMsg
sSubject = "Test"
sEmail = "xxxxxxxxxx@outlook.com"
sMailBody = "This is a test message. wibble"
sFrom = "sender@domain.com"
sReadReceipt = true
sMsg = ""

On Error Resume Next

dim oMail, oConfig, oConfigFields
set oMail = Server.CreateObject("CDO.Message")
set oConfig = Server.CreateObject("CDO.Configuration")
set oConfigFields = oConfig.Fields

with oConfigFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = SMTPSendUsing
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPServerPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPUser
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPassword
.Update
end with
oMail.Configuration = oConfig

oMail.Subject = sSubject
oMail.From = sFrom
oMail.To = sEmail
oMail.HTMLBody = sMailBody

oMail.Send
set oMail=nothing

sMsg = "Message Sent"

if Err.Number > 0 then sMsg = "ERROR: " & Err.Description

Response.Write sMsg

%>

Edited by - snowbird30ds on 12 October 2020 14:42:36

HuwR
Forum Admin

United Kingdom
20550 Posts

Posted - 13 October 2020 :  07:53:27  Show Profile  Visit HuwR's Homepage  Reply with Quote
in inc_mail.asp look for the case "cdosys" section. you need to change this part

	        'Set and update fields properties
        	Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
	        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") = "username"
			'Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

Try changing it to

        	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/smtpserverport") = 587
			Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
			Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = YOUR MAIL USER
			Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = YOUR MAIL PASSWORD

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

snowbird30ds
Starting Member

United Kingdom
33 Posts

Posted - 13 October 2020 :  12:34:37  Show Profile  Reply with Quote
Thanks Huw.
It will send email now between members but the registration emails are not coming through either to admin or to the new member when approved, email settings as below.
Any idea what I'm missing?

Also the last two boxes always show as empty even though I fill them when I update configuration, is that normal?

Edited by - snowbird30ds on 13 October 2020 12:36:16
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20550 Posts

Posted - 13 October 2020 :  17:02:11  Show Profile  Visit HuwR's Homepage  Reply with Quote
The none delivery is because the sender needs to be a valid address on the mail server, by default I think it sets the from address which is different. I will check if that can be set differently for cdosys.

Not sure why your other settings don't appear.

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

HuwR
Forum Admin

United Kingdom
20550 Posts

Posted - 13 October 2020 :  19:43:51  Show Profile  Visit HuwR's Homepage  Reply with Quote
OK, it should support setting sender, so try this, after the code below in the cdosys part of inc_mail

		objNewMail.To = strRecipients
		objNewMail.From = strSender
		objNewMail.Subject = strSubject
		objNewMail.TextBody = strMessage

insert the following line immediately below it and before the send command.
objNewMail.Sender = "AN EMAIL ADDRESS THAT IS VALID ON YOUR MAIL ACCOUNT"

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

snowbird30ds
Starting Member

United Kingdom
33 Posts

Posted - 14 October 2020 :  17:17:49  Show Profile  Reply with Quote
Still sends ok member to member but no registration emails.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20550 Posts

Posted - 14 October 2020 :  20:00:02  Show Profile  Visit HuwR's Homepage  Reply with Quote
not sure then, I would expect it to be a problem the other way round to be honest

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2019 Snitz™ Communications Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000 Version 3.4.07