473,782 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I use CDONTS.new to send an email with attachment?

Can someone give me some sample code to use CDONTS.new to send email
with an attachment?

I've got sample code from the following website;

http://msdn.microsoft.com/library/en...asp?frame=true

But, I'm having trouble GETTING the relevant field from my HTML form!
I can't seem to be able to get the field property. :(
It just comes up as a blank.

Any help would be appreciated.

Thanks.
Jam
Jul 19 '05 #1
2 1887
Is the problem with how to attach a file to a CDONTS message or how to
accept a file from that a user uploaded first? Is that the source of the
file? If so, you must first save the file to the file system on your server
and then use the .AttachFile method of the CDONTS.NewMail object.

For further help, please provide more details, like code, error messages,
etc.

Ray at home

"Jammer" <ja*********@ya hoo.co.uk> wrote in message
news:97******** *************** ***@posting.goo gle.com...
Can someone give me some sample code to use CDONTS.new to send email
with an attachment?

I've got sample code from the following website;

http://msdn.microsoft.com/library/en...asp?frame=true

But, I'm having trouble GETTING the relevant field from my HTML form!
I can't seem to be able to get the field property. :(
It just comes up as a blank.

Any help would be appreciated.

Thanks.
Jam

Jul 19 '05 #2
On 17 Oct 2004 09:25:18 -0700, ja*********@yah oo.co.uk (Jammer) wrote:
Can someone give me some sample code to use CDONTS.new to send email
with an attachment?

I've got sample code from the following website;

http://msdn.microsoft.com/library/en...asp?frame=true

But, I'm having trouble GETTING the relevant field from my HTML form!
I can't seem to be able to get the field property. :(
It just comes up as a blank.


This could be a problem with the form, your method of retrieving it or
the code you use.

First, stop using CDONTS and use CDO instead. See:

http://www.aspfaq.com/show.asp?id=2026

Second, are you able to send mail but not with an attachment, or not
send mail at all? Have you tried just sending messages with
attachments without pulling information from a form? You said the
field property comes up as a blank, have you tried a Response.Write to
see what is actually being processed by the form?

Post relevant code snippets for real help.

Jeff
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2547
by: maher | last post by:
Hi I am using the CDONTS.newmail object to send file as an attachment so I used attachfile method. it seems the attach file wont work if the file size more than 100 KB , does anybody know if there is a size limit or where to change it I am using the SMTP server included with IIS 5.0. PS when file is sent, it will show on the EMAIL as an attachment only with 0 bytes.
3
4666
by: Ryan McLean | last post by:
Hello everyone! I have a question for ya'll. In a web-based asp application I am creating and (attempting to) attach a file. The email sends correctly, but when I try to open the attachment, it is blank. Now, I know you all are probably thinking that the file is blank on the server or it doesn't exist at the address that I specify. Well, I checked on the server and the file is there and there is stuff in it. Could this be a...
2
6297
by: Kyle Pula | last post by:
I am using CDONTS to send email from an ASP script. Attached to each of these emails is a 34K PDF file. 90% of the time the file arrives intact. 10% of the time, however, users are unable to open the file. It appears that users using some sort of webmail recieve an improperly decoded version of the file where as users of POP3 non-web email clients (e.g. Outlook) generally recieve the file intact.
12
1976
by: tshad | last post by:
I am trying to run a test sending mail using CDONTS on my W2K3 machine. It works fine running from my WXP Pro, but I don't recieve the mail if run the W2K3 machine. Both machines have IIS configured essentially the same. ******************************************************************************************
0
1184
by: Serge | last post by:
Hello! I'm using godaddy ASP hosting and i have no permission to create files on disk from asp script. I need to generate excel file and send it via email in asp page. I'm sending email using CDONTS All examples, i've found in internet, show how to attach to the email file from disk. In documentation for CDONTS told, that there is possibility to attach to the
5
2636
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it depending on member expiration dates. When the form is submitted, the code loops through the form contents and sends an email to those members that meet the selected criteria. All this worked perfectly when I was sending text emails, but since I
4
1872
by: Jason Steeves | last post by:
I am using cdonts to send mail messages with an attachment. The problem I am having is the messages are going through OK but the attachments are not there. Any ideas? I have tried my code elsewhere and it looks OK...........Jason
7
2890
by: Paul | last post by:
I have just started work on a system using CDONTS to mail out. Whilst this is fine on the server, my local development machine is using XP Pro with IIS5.1 installed. Is there a way I can get the functionality of cdonts so that I can test/develop on my local machine, preferably without actually sending any mail to the persons involved.
0
1591
by: jbguernsey | last post by:
I am hoping to be able to avoid the Outlook security problem by using CDONTS and I tried using the code below (with appropriate change to the address etc): Dim oEMail As New CDONTS.EMail oEMail.From "anyn...@anydomain.com" oEMail.To "yourem...@yourdomain.com" oEMail.BodyFormat = CdoBodyFormatText oEMail.Body = "Insert some useful text here"
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.