Ciao a tutti
volevo sapere se avete il problema
Impossibile accedere all'oggetto 'CDO.Message'.
con Win2003 , e ASP.NET
premessa..
Sub Send_Mail(obj as object,e as eventargs)
Dim objMessaggio as MailMessage = new MailMessage
Dim Result as boolean = false
Dim res_email as boolean = false
objMessaggio.BodyFormat = MailFormat.Text
objMessaggio.To = "luca.gabrielli@schnell.it"
objMessaggio.From = tbox_email.text
objMessaggio.Priority = MailPriority.High
objMessaggio.Subject = tbox_Oggetto.text
objMessaggio.Body = tbox_Nome.text & tbox_Cognome.text & tbox_Messaggio.text
SmtpMail.SmtpServer = "localhost"
if tbox_email.text <> "" and tbox_oggetto.text <> "" and tbox_nome.text <> "" and tbox_cognome.text <> "" and tbox_messaggio.text <> "" then
'Check to make sure that the email addy is in the right form
Dim strEmail as String, strPattern as String
strEmail = tbox_Email.Text
strPattern = "^[\w-_\.]+\@([\w]+\.)+\w+$"
If Not Regex.IsMatch(strEmail, strPattern, RegexOptions.IgnoreCase) then
'Invalid email address form!
lbl_message.text = "
<font color=red>Your email address is in an" & _
" illegal format.</font>
"
Else
'Check to see if the domain name entered in the email address exists
Dim strDomain as String
strDomain = strEmail.Substring(strEmail.IndexOf("@") + 1)
'Attempt to Resolve the hostname
Dim strIP as String
try
strIP = DNS.Resolve(strDomain).AddressList(0).ToString()
'If we reach here, we have a valid email address, so do whatever
'processing or whatnot needs to be done...
lbl_message.text = "
Valid email address. Your domain name has " & _
"an IP of " & strIP & ". Thank you!"
res_email = true
catch se as SocketException
'The DNS resolve was unsuccessful...
strIP = se.Message
lbl_message.text = "
<font color=red>" & strIP & "</font>
"
res_email = false
end try
End If
if res_email = true then
try
SmtpMail.Send(objMessaggio)
Result = True
catch smtperror as Exception
Result = False
lbl_message.text = smtperror.message
End Try
if Result = True then
lbl_message.text = "
<font face=Tahoma color=red>Message send correctly!</font>"
else
'lbl_message.text = "
<font face=Tahoma color=red >Message not send! Please contact the Web Administrator!!</font>
<a href=mailto:luca.gabrielli@schnell.it>Webmaster</a>"
end if
end if
else
lbl_message.text = "
<font face=Tahoma color=red >All field is required! Please complete the information and re-send the form.</font>"
end if
End Sub
Questo è il codice e mi continua a dare l'errore CDO.Message
ho provato a cercare su internet , non solo qui... ma tutti
hanno ASP 3.0 non . NET e non capisco dove sbaglio.
Lo stesso codice girava fino a 3 giorni fa in un server win2000 e andava DA DIO!!!
SMTP è avviato correttamente...
VI PREGO AIUTO !!![]()
![]()
![]()