473,602 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ 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.tx t")

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 1086
figured out a way - just looping with dirinfo and attaching only those that
meet the spec.

Tx

Bernie

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

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*****@cherwe llinc.com> scripsit:
I know how to attach a document to an email inside vb .net with
msg.attachments .add("c:\ppp.tx t")

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.GetFi les("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*****@cherwe llinc.com> scripsit:
I know how to attach a document to an email inside vb .net with
msg.attachments .add("c:\ppp.tx t")

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.GetFi les("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
5448
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. I want to develop a webpage where people can send attachments that are stored on their local PC.
3
1670
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 bit of code that did not need classes and I could plug easily into my PHP code. I thought I found one (see bottom of email), however I have since discovered that as it is, this script has the following disadvantages when compared to using...
4
2414
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 somewhat unusual places where multi-instance singleton is more useful than plain singleton, it seems to me that the former leads to less coding, so unless I can somehow package the singleton pattern in a superclass (so I don't have to code it...
3
3138
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 things makes me download the complete message first, attachements and all: mail = for j in M.retr(i): mail.append(j.rstrip()) inMail = email.message_from_string('\r\n'.join(mail)) I don't have a real problem per se with this, it's just that I...
0
905
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 throw some light on how i can do this thanks
1
2094
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 message 4. Upload the attachements to the filesystem 5. Write the path of the attachements to the SQL server record
1
1183
by: mkadasi | last post by:
i want to get attachements from outlook and save under windows folder but through programmatically in vb.net
3
2514
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 seems to work fine. I first looked at the mimetools modules but it says it is depreceated since 2.3, so I started trying to use the email module. Here is a script that basically follows the second example given in section 7.1.13 of the Python...
2
2387
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
6898
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 of them seem to be very lowlevel or lacking in functionality. Is there a good script, class or example for decoding email attachments? I have used a class called attachmentread, but this class expects an attachment as disposition: attachment,...
0
7993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8404
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
8054
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,...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5867
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
3900
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...
1
2418
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
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
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.