473,480 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

email attachements in vb .net

I know how to attach a document to an email inside vb .net with
msg.attachments.add("c:\ppp.txt")

However, is there a way to attach files via wildcards - eg, c:\p*.txt to get
c:\ppp.txt and c:\ppw.txt? I tried it directly but got an unrecognized cast
error.

Thanks for any help.

Bernie Yaeger
Nov 20 '05 #1
3 1078
figured out a way - just looping with dirinfo and attaching only those that
meet the spec.

Tx

Bernie

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:u7***************@TK2MSFTNGP10.phx.gbl...
I know how to attach a document to an email inside vb .net with
msg.attachments.add("c:\ppp.txt")

However, is there a way to attach files via wildcards - eg, c:\p*.txt to get c:\ppp.txt and c:\ppw.txt? I tried it directly but got an unrecognized cast error.

Thanks for any help.

Bernie Yaeger

Nov 20 '05 #2
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
I know how to attach a document to an email inside vb .net with
msg.attachments.add("c:\ppp.txt")

However, is there a way to attach files via wildcards - eg, c:\p*.txt to get
c:\ppp.txt and c:\ppw.txt? I tried it directly but got an unrecognized cast
error.


\\\
For Each s As String In Directory.GetFiles("C:\p*.txt")
...
Next s
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Tx Herfried - as usual, your solution was more elegant than mine!

Bernie

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de...
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
I know how to attach a document to an email inside vb .net with
msg.attachments.add("c:\ppp.txt")

However, is there a way to attach files via wildcards - eg, c:\p*.txt to get c:\ppp.txt and c:\ppw.txt? I tried it directly but got an unrecognized cast error.


\\\
For Each s As String In Directory.GetFiles("C:\p*.txt")
...
Next s
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #4

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

Similar topics

5
5426
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
3
1663
by: Dave Smithz | last post by:
Hi there, Previously in my PHP code I was using Sendmail to send out emails to people in the MySQL DB. The requirement cam along to be able to send attachments and so I dug around for an easy...
4
2398
by: Neil Zanella | last post by:
Hello, I would be very interested in knowing how the following C++ multi-instance singleton (AKA Borg) design pattern based code snippet can be neatly coded in Python. While there may be...
3
3128
by: LutherRevisited | last post by:
Is there a way I can put a message together without having to download any attachments there may be at the same time. I'm not having any problems dealing with attachments, but the way I'm doing...
0
901
by: Pankaj Banga | last post by:
I need to create an application that checks email sent to a particular address on mail server and extract any attachments from these emails. I am using mail server 2003. Could someone please...
1
2084
by: hanan_cohen | last post by:
Shalom, I am looking for a system that will: 1. Read a message from a POP3 mailbox 2. Parse the message into its parts 3. Create a record in an SQL server table with selected fields of the...
1
1174
by: mkadasi | last post by:
i want to get attachements from outlook and save under windows folder but through programmatically in vb.net
3
2500
by: Erik Johnson | last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an attached HTML file. I have scripts that send basic emails via the smtplib module that don't have any attachements and that...
2
2382
by: Netaro | last post by:
Hello! Well, i want to send an email to some specified adress using c++. Is there any function that sends email (with attachements, or just a plain simple text) to specified adress?
3
6894
by: olafmol | last post by:
Hello, i want to write a PHP4 script that reads POP3 or IMAP mail and can decode the possible attachments in the email. I've looked around for some classes to do this, and found a few, but most...
0
7044
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
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...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4483
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...
0
2995
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...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
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 ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
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...

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.