I have a small booking system for a charity which sends emails to patients when they book an appointment.
When developed they used a windows server which worked fine , since they have moved to NAS and we now miss the occasional email.
The code used is below.
Can it be a time out problem or what errors should I try to trap.
The NAS in my opinion is slow??
Option Compare Database
Option Explicit
Function emailadd1(ema, noteb, notea)
Dim loaded, notec
Dim noted
Dim objMessage
noted = Chr$(13) & Chr$(13) & Chr$(13) & Chr$(13)
noted = noted & "The Sussex Multiple Sclerosis Treatment Centre Limited" & Chr$(13)
noted = noted & "A company limited by guarantee, Registered in the UK,Company registration no. 2319928" & Chr$(13)
noted = noted & "Registered office:- " & Chr$(13)
noted = noted & "Southwick Recreation Ground" & Chr$(13)
noted = noted & "Croft Avenue" & Chr$(13)
noted = noted & "Southwick " & Chr$(13)
noted = noted & "West Sussex" & Chr$(13)
noted = noted & "BN42 4AB" & Chr$(13)
notec = "This is an automated e-mail. DO NOT reply to this e-mail. If you need further information call the centre on 01273 594484"
' see if an email
If ema > "" Then
' email present
GoSub sr1
End If
Exit Function
sr1:
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = noteb
objMessage.from = "bookings@mssussex.com"
objMessage.To = ema
objMessage.TextBody = notec & Chr$(13) & notea & noted
' add for each attachment
' objMessage.AddAttachment "c:\attach.doc"
With objMessage.Configuration.Fields
.Item(" = 2
.Item(" = "smtp.lcbroadband.com"
.Item(" = 25
.Update
End With
On Error Resume Next
objMessage.Send '
Return
End Function
When developed they used a windows server which worked fine , since they have moved to NAS and we now miss the occasional email.
The code used is below.
Can it be a time out problem or what errors should I try to trap.
The NAS in my opinion is slow??
Option Compare Database
Option Explicit
Function emailadd1(ema, noteb, notea)
Dim loaded, notec
Dim noted
Dim objMessage
noted = Chr$(13) & Chr$(13) & Chr$(13) & Chr$(13)
noted = noted & "The Sussex Multiple Sclerosis Treatment Centre Limited" & Chr$(13)
noted = noted & "A company limited by guarantee, Registered in the UK,Company registration no. 2319928" & Chr$(13)
noted = noted & "Registered office:- " & Chr$(13)
noted = noted & "Southwick Recreation Ground" & Chr$(13)
noted = noted & "Croft Avenue" & Chr$(13)
noted = noted & "Southwick " & Chr$(13)
noted = noted & "West Sussex" & Chr$(13)
noted = noted & "BN42 4AB" & Chr$(13)
notec = "This is an automated e-mail. DO NOT reply to this e-mail. If you need further information call the centre on 01273 594484"
' see if an email
If ema > "" Then
' email present
GoSub sr1
End If
Exit Function
sr1:
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = noteb
objMessage.from = "bookings@mssussex.com"
objMessage.To = ema
objMessage.TextBody = notec & Chr$(13) & notea & noted
' add for each attachment
' objMessage.AddAttachment "c:\attach.doc"
With objMessage.Configuration.Fields
.Item(" = 2
.Item(" = "smtp.lcbroadband.com"
.Item(" = 25
.Update
End With
On Error Resume Next
objMessage.Send '
Return
End Function