Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP Email With Attachments Failure using CDO.Message

Reply
Thread Tools

ASP Email With Attachments Failure using CDO.Message

 
 
Naveen Jain
Guest
Posts: n/a
 
      07-17-2006
Hi All,

I'm using this code to send a e-mail with attachment:

Dim oCdoMail
Set oCdoMail = Server.CreateObject("CDO.Message")
oCdoMail.From = strFromEmail
oCdoMail.To = strToEmail
oCdoMail.Subject = "Job Information"
oCdoMail.TextBody = "This is the email notification"
oCdoMail.AddAttachment strFileName
oCdoMail.Configuration.Fields.Item=2
oCdoMail.Configuration.Fields.Item=<My mail server IP>
oCdoMail.Send

This code scuccessfully send mail with attchment on my local. But when we
uplaod this code to the web server this is forceing error. If i mark comment
the folowing code
"oCdoMail.AddAttachment strFileName" this will work fine on the server, but
i need to send e-mail with attachments. how it could be possible ?

Please help me and suggest the way ASAP.
Thanks in Advance

Naveen Jain
OTS Solutions Pvt. Ltd.,
Guraon (India)

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      07-17-2006

"Naveen Jain" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
>
> I'm using this code to send a e-mail with attachment:
>
> Dim oCdoMail
> Set oCdoMail = Server.CreateObject("CDO.Message")
> oCdoMail.From = strFromEmail
> oCdoMail.To = strToEmail
> oCdoMail.Subject = "Job Information"
> oCdoMail.TextBody = "This is the email notification"
> oCdoMail.AddAttachment strFileName
> oCdoMail.Configuration.Fields.Item=2
> oCdoMail.Configuration.Fields.Item=<My mail server IP>
> oCdoMail.Send
>
> This code scuccessfully send mail with attchment on my local. But when we
> uplaod this code to the web server this is forceing error. If i mark

comment
> the folowing code
> "oCdoMail.AddAttachment strFileName" this will work fine on the server,

but
> i need to send e-mail with attachments. how it could be possible ?
>
> Please help me and suggest the way ASAP.


It would help if you tolds what error you are getting?

Also how does this manage to work at all:-

oCdoMail.Configuration.Fields.Item=2
oCdoMail.Configuration.Fields.Item=<My mail server IP>

I suspect you meant:-

oCdoMail.Configuration.Fields.Item=2
oCdoMail.Configuration.Fields.Item=<My mail server IP>

With oCdoMail.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = IP
address
.Update ' You had this missing as well
End With

Also did you change the IP address to something the Web server can access?
Does the Web server not already have the configuration set correctly to send
emails?
Consider creating your own instance of the Configuration object like this:-

Dim oConf : Set oConf = Server.CreateObject("CDO.Configuration")

With oConf .Configuration
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = IP
address
.Update
End With

Set oCdoMail.Configuration = oConf

This avoids any conflicting values in the default configuration messing up
what you are trying to do.


> Thanks in Advance
>
> Naveen Jain
> OTS Solutions Pvt. Ltd.,
> Guraon (India)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail.Attachments (Multiple Attachments) from Querystring codewarrior ASP .Net 0 05-04-2009 07:19 PM
Getting/Saving email attachments w/ poplib and email modules brettk@gmail.com Python 2 06-22-2005 12:44 PM
Lemme ask again re .email extension as email attachments?? JustMe Computer Support 1 06-15-2005 11:11 PM
attachments unable to read attachments from email bub.mk Computer Support 1 09-29-2004 02:29 AM
Can't attach attachments in email using ASP CDO tabonni ASP General 15 09-01-2004 12:58 AM



Advertisments