Hi Poppy,
Here's a few lines of code that works just fine. One of the things you
might want to investigate is if the .from address is valid and working
properly and also check the smtpmail.smtpserver address and working status:
Dim msg As New MailMessage()
msg.To = "be*****@optonline.net"
msg.From = "be*****@cherwellinc.com"
msg.Subject = "test subject"
msg.Body = "this is the test info"
Dim astring1 As String = "c:\my documents\wzo letter.doc"
msg.Attachments.Add(New MailAttachment(astring1))
Dim astring2 As String = "c:\my documents\visual basic notes.doc"
msg.Attachments.Add(New MailAttachment(astring2))
msg.Cc = "we*******@cherwellinc.com"
SmtpMail.SmtpServer = "smtp.registeredsite.com"
Try
SmtpMail.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
HTH,
Bernie Yaeger
"Poppy" <pa**********@themedialounge.com> wrote in message
news:06****************************@phx.gbl...
The following line of code :
SmtpMail.Send(objEmail)
Produces this error :
"System.Runtime.InteropServices.COMException: Unspecified
error"
Can anyone help ?
I have included "Imports System.Web.Mail" at the top of my
code behind page and intelisence reveals all appropriate
properties and methods.