ranta
Programmer
- Jun 24, 2003
- 30
Hi,
I am currently sending a HTML newsletter from an ASP application using the script below. I have used this in many applications with no issue however I am now facing a problem that when the HTML content (which I have validated by printing to the screen) is sent using the .send command a random space is appears right in the middle of a <br /> statement, this space appears between the b and the r and the email clients then render this as a <b> and embolden all content after the tag.
The random spaces always appears in the same place and is not there just prior to the .send command. Is there a possibility that using the CDO.message method has a character limit and it actualy trys to create line breaks or split the email into packets therefore generating this space?
Any assitance would be greatly appreciated as I am pulling my hair out here... Thanks!
Dim iMsg,iConf
On Error Resume next
Server.ScriptTimeout = 9000
If emailto<>"" And emailFRom<>"" Then
Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
'Set the fields of the configuration object to send by using SMTP through port 25.
With iConf.Fields
.item(" = cdoSendUsingPort
.item(" = strSmartHost
.Update
End With
With iMsg
.To = emailTo
.From = emailFrom
.Subject = subject
If CC <> "" Then
.cc=cc
End If
If BCC <> "" Then
.bcc=bcc
End If
If html = 2 Then
.HTMLBody = body
.TextBody = body
Elseif html = 1 then
.HTMLBody = body
else
.TextBody = body
End if
If attachment <> "" Then
.AddAttachment attachment
End if
.Send
End With
set iMsg = Nothing
If Err.Number = "" Or Err.Number="0" Then
sendEmail = 1
Else
sendEmail = Err.number
End if
Else
sendEmail = -1
End If
I am currently sending a HTML newsletter from an ASP application using the script below. I have used this in many applications with no issue however I am now facing a problem that when the HTML content (which I have validated by printing to the screen) is sent using the .send command a random space is appears right in the middle of a <br /> statement, this space appears between the b and the r and the email clients then render this as a <b> and embolden all content after the tag.
The random spaces always appears in the same place and is not there just prior to the .send command. Is there a possibility that using the CDO.message method has a character limit and it actualy trys to create line breaks or split the email into packets therefore generating this space?
Any assitance would be greatly appreciated as I am pulling my hair out here... Thanks!
Dim iMsg,iConf
On Error Resume next
Server.ScriptTimeout = 9000
If emailto<>"" And emailFRom<>"" Then
Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
'Set the fields of the configuration object to send by using SMTP through port 25.
With iConf.Fields
.item(" = cdoSendUsingPort
.item(" = strSmartHost
.Update
End With
With iMsg
.To = emailTo
.From = emailFrom
.Subject = subject
If CC <> "" Then
.cc=cc
End If
If BCC <> "" Then
.bcc=bcc
End If
If html = 2 Then
.HTMLBody = body
.TextBody = body
Elseif html = 1 then
.HTMLBody = body
else
.TextBody = body
End if
If attachment <> "" Then
.AddAttachment attachment
End if
.Send
End With
set iMsg = Nothing
If Err.Number = "" Or Err.Number="0" Then
sendEmail = 1
Else
sendEmail = Err.number
End if
Else
sendEmail = -1
End If