Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Mail Configuration
 Email not working

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
mark_laverty Posted - 03 October 2011 : 07:04:04
Hi!

First off, thank you for taking the time to read this. You help is much appreciated :-)

I have a snitz forum I have set up but I can't seem to get mail working. its at http://www.mltek.co.uk/forum.

Heres the contents of the inc_mail.asp file, I have removed everything that isn't 100% needed and I still can't get it to work..

<%
if trim(strFromName) = "" then
strFromName = strForumTitle
end if


Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields

'Set and update fields properties
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/smtpusessl") = False
Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxxxxx@mltek.co.uk"
Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxxxx"
Flds("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "xxxxxxxx@mltek.co.uk"


Flds.Update

Set objNewMail = Server.CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf

'Format and send message
Err.Clear

objNewMail.To = strRecipients
objNewMail.From = strSender
objNewMail.Subject = strSubject
objNewMail.TextBody = strMessage
On Error Resume Next
objNewMail.Send

If Err <> 0 Then
Err_Msg = Err_Msg & "<li>Your request was not sent due to the following error: " & Err.Description & "</li>"
End if


Set objNewMail = Nothing

on error goto 0
%>

If I run the testemailcomponent.asp page it shows that cdo is available (its the only one is shows as being avalable).

If I try to use the sendmail function when looking at a users profile it says that the message was sent, but the email never arrives.

If I try to register a new user then they dont recieve the confirmation email to the email address that they entered.

I am 99% sure that the SMTP details I have entered are correct. I can send and recieve email from this account using Outlook with the same settings.. any sugestions?
8   L A T E S T    R E P L I E S    (Newest First)
Podge Posted - 03 October 2011 : 10:24:31
Glad you got it working.
mark_laverty Posted - 03 October 2011 : 10:01:06
quote:
Originally posted by Podge

Are you sure that strMailServer is set correctly? Try hardcoding it or entering the i.p. address.



Ok.. fixed it.. BUT I'm not 100% sure how.

I tweaked the script.. set the strmailserver to "localhost", deleted and re-created the mail account I am using and re-created it without a leading "_" in the password as the hosting providers site didnt seem to like that.

Here's the script as it is on the website now..

<%
if trim(strFromName) = "" then
strFromName = strForumTitle
end if
Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields

'Set and update fields properties
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/smtpusessl") = false
Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdobasic
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxx@mltek.co.uk"
Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxx"
Flds("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "xxxxx@mltek.co.uk"
Flds.Update

Set objNewMail = Server.CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf

'Format and send message
Err.Clear
objNewMail.To = strRecipients
objNewMail.From = strSender
objNewMail.Subject = strSubject
objNewMail.TextBody = strMessage
On Error goto 0
objNewMail.Send



If Err <> 0 Then
Err_Msg = Err_Msg & "<li>Your request was not sent due to the following error: " & Err.Description & "</li>"
End if
Set objNewMail = Nothing
on error goto 0
%>

So that seems to work great and I now have emails flowing even to external domains

Thank you very much for your help
Podge Posted - 03 October 2011 : 09:23:59
Are you sure that strMailServer is set correctly? Try hardcoding it or entering the i.p. address.
mark_laverty Posted - 03 October 2011 : 08:52:21
Interestingly if I change use SSL to 'True' then I get this message...

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/forum/inc_mail.asp, line 30

If I set it back to False then I get the previous message again. I guess that means that at least it is trying to connect to the server and failing as opposed to not even trying.
mark_laverty Posted - 03 October 2011 : 08:47:58
Ok, script changed... I now get this..

"Send an E-MAIL Message

error '80040211'
/forum/inc_mail.asp, line 30
"

Heres the script exactly as it is on the server (with the exception of the 'xxxx's to not disclose sensitive information.


<%
if trim(strFromName) = "" then
strFromName = strForumTitle
end if
Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields

'Set and update fields properties
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/smtpusessl") = False
Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxx@mltek.co.uk"
Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxx"
Flds("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "xxxx@mltek.co.uk"
Flds.Update

Set objNewMail = Server.CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf

'Format and send message
Err.Clear
objNewMail.To = strRecipients
objNewMail.From = strSender
objNewMail.Subject = strSubject
objNewMail.TextBody = strMessage
On Error goto 0
objNewMail.Send
If Err <> 0 Then
Err_Msg = Err_Msg & "<li>Your request was not sent due to the following error: " & Err.Description & "</li>"
End if
Set objNewMail = Nothing
on error goto 0
%>
Podge Posted - 03 October 2011 : 08:29:02
Try changing this

On Error Resume Next
objNewMail.Send


to this


On Error goto 0
objNewMail.Send


and then try to send an email. Post any error here.
mark_laverty Posted - 03 October 2011 : 07:47:49
quote:
Originally posted by Podge

Does your host have any code samples for sending email? Or any instructions at all?



Nothing that I have found.. BUT I do use .net in an aspx page to send mail from webforms on the root site..

Dim msg As New MailMessage
Dim emailClient As New SmtpClient("localhost", 25)
Dim SMTPUserInfo As New System.Net.NetworkCredential("xxxxxx@mltek.co.uk", "xxxxxxx")
Dim FromAddress As New System.Net.Mail.MailAddress("xxxxxx@mltek.co.uk")
msg.To.Add("xxxxxx@mltek.co.uk")
msg.From = FromAddress
emailClient.UseDefaultCredentials = False
emailClient.Credentials = SMTPUserInfo

msg.Subject = "abc123"
msg.Body = "abc123"
emailClient.Send(msg)
Response.Redirect("confirm.aspx")
Podge Posted - 03 October 2011 : 07:25:45
Does your host have any code samples for sending email? Or any instructions at all?

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000 Version 3.4.07