473,738 Members | 5,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

E-mail Attachment

Hello everyone, using A2003

I would like to send via email a txt file located on the c:\ drive
which I create by using a transfer text procedure.

My problem is that the file name is variable, such as RefMMDDHHmm where
REF is a fixed value, so..... the question?

How can I adapt this code that I normally use to send email with
attachments, to send the txt file when I only know the first 3
characters e.g 888

Dim objOutlook As Outlook.Applica tion
Dim objEmail As Outlook.MailIte m

Set objOutlook = CreateObject("O utlook.Applicat ion")
Set objEmail = objOutlook.Crea teItem(olMailIt em)

With objEmail
.To = "email address"
.Subject = "subject"
.Body = "Notes"
.Attachments.Ad d "ATTACHMENT "
.Send
End With

Set objOutlook = Nothing

P.S. I was looking into BLAT e-mailing but could it get it to work, can
some point me to the a website with a full explanation on how to use
such email system? I would appreciate it. (I already got the BLAT.exe
and the VB class, but every time I run it I get an error. do I need to
reference something???

Thanx

Nov 13 '05 #1
2 2110
GAVO-UK wrote:
P.S. I was looking into BLAT e-mailing but could it get it to work, can
some point me to the a website with a full explanation on how to use
such email system? I would appreciate it. (I already got the BLAT.exe
and the VB class, but every time I run it I get an error. do I need to
reference something???


Blat references the smtp address and a user address in a registry
setting. I used to use Blat in a win 98 environment, but my A97 app
with it failed when the user converted to winXP. Since the command line
I shell out for blat mailing is something that references text file
locations and with the XP user documents line so darn long and the
limitation (in the win98 command prompt, anyway) of a certain number of
characters permitted, I gave up trying to use blat. mind you, I don't
know what versions are available now - I was using the latest Blat about
3 or 4 years ago.

I switched back to using sendobject which has it's own problems in
A2003, not least being the inability of Netscape 7.x to recreate the
"to" addresses, ie, emails are constructed without any addressees. I've
had to address this by having the edit argument set to true and whenever
my app with email generates an email, a form appears with the to
address(es) showing (and a button to bypass this form, if the user's
email configuration works). The send button on that form invokes the
sendobject command and uses an API procedure to copy the adress(es) to
the clip board so that when a user sees there's no to address on their
email, they can paste it.

Klunky as hell, but, as I mentioned, unless you're using Outlook,
sendobject has at least one problem.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
Use the DIR function to find all files starting with 888 then attach them
like your "known" file names.

"GAVO-UK" <an****@peoplee x.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hello everyone, using A2003

I would like to send via email a txt file located on the c:\ drive
which I create by using a transfer text procedure.

My problem is that the file name is variable, such as RefMMDDHHmm where
REF is a fixed value, so..... the question?

How can I adapt this code that I normally use to send email with
attachments, to send the txt file when I only know the first 3
characters e.g 888

Dim objOutlook As Outlook.Applica tion
Dim objEmail As Outlook.MailIte m

Set objOutlook = CreateObject("O utlook.Applicat ion")
Set objEmail = objOutlook.Crea teItem(olMailIt em)

With objEmail
.To = "email address"
.Subject = "subject"
.Body = "Notes"
.Attachments.Ad d "ATTACHMENT "
.Send
End With

Set objOutlook = Nothing

P.S. I was looking into BLAT e-mailing but could it get it to work, can
some point me to the a website with a full explanation on how to use
such email system? I would appreciate it. (I already got the BLAT.exe
and the VB class, but every time I run it I get an error. do I need to
reference something???

Thanx

Nov 13 '05 #3

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

Similar topics

4
26762
by: Wald | last post by:
Hello group, I've got a script here that sends emails with an attachment to an email address that is retrieved from an html form. The email sending code is include below. The problem: when sending the email to certain email servers, the attachment section of the email gets removed and I end up with an attachment of zero kb. Other servers do accept the attachment as expected.
3
7049
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt. Obviuosly, the file is fine on the server, so the attachment code I am using must be corrupting it, but I dont know what it is: // send email with attachment function emailAttachment($to, $subject, $message, $name, $email,
1
3525
by: abracad | last post by:
I'd like to add a form that will email a file attachment to me. Can anyone recommend a decent free script? Thanks
2
8697
by: New User | last post by:
Hi, I have a PDF file that I am trying to send as an attachment through a C# program. Even though the PDF file can be opened by itself, sometimes the same file cannot be opened as an attachment. If I try and open the original PDF file I have no problems. I have used System.Web.Mail.MailMessage to create an email and an SMTPMail object to send the mail.
7
16590
by: Susan Bricker | last post by:
I would like to generate a report (I have the report working already) using MS/ACCESS 2000 and then have the ability to send the report as an email attachment to my colleagues. I have looked around in the MS/ACCESS Help facility and found that I can click on FILE (on the Menu Bar) and then click on SEND TO. This will generate, either, a 'Snapshot format' or 'Rich Text Format' file and send an email. Two problems: 1. Is it possible to...
6
10453
by: brendan_gallagher_2001 | last post by:
Hi, Does anyone know how to create an attachment using a stream in classic ASP. I can see that it can be done in ASP.Net as per the article below: Initializes a new instance of the Attachment class with the specified stream and name. http://msdn2.microsoft.com/en-us/library/6sdktyws.aspx.
7
7645
by: erikcw | last post by:
Hi all, I'm trying to extract zip file (containing an xml file) from an email so I can process it. But I'm running up against some brick walls. I've been googling and reading all afternoon, and can't seem to figure it out. Here is what I have so far. p = POP3("mail.server.com")
6
4727
by: jordanbondo | last post by:
I need to be able to connect to MS Exchange 2007 and find a particular email with a particular attachment on it. This attachment is sent to multiple people, but I have an account set up where the email with the attachment will be the only message being sent to that inbox. Is there a way to look through exchange to fine a particular email sent to a particular recipient and retrieve the message's attachment? I've looked through the MSDN library,...
1
1420
by: =?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= | last post by:
Greetings, This question does not seem to fit any of the forum headers so I picked the most general sounding forum I could find. My laptop is running Vista Ultimate. I use yahoo.com for business email and use their web based email client for my business account. Yesterday I received an email with a .pdf attachment. When I went to save the attachment the browser window refreshed but no dialog appeared asking me
0
2027
by: peterschedler | last post by:
How do I send an MS Word (2002) document file ( 140 MB )as a .txt email attachment and how can the recipient open it ? I am using ORANGE webmail and Mozilla Firefox .
0
8968
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
8787
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
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
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
9259
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
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
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
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.