473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Attachments in VS2003 web mail

In a windows form app the code I got is
Dim AttachItem As String

If MailAttachments <"" Then 'The fully qualified paths of all the files
that I want to attach

Dim delimStr As String = ";"

Dim delimiter As Char() = delimStr.ToCharArray()

Dim split As String() = Nothing

split = MailAttachments.Split(delimiter)

For Each AttachItem In split

Dim attachment As New MailAttachment(AttachItem) 'create the attachment

mailMsg.Attachments.Add(attachment) 'add the attachment

Next AttachItem

End If

The line

mailMsg.Attachments.Add(attachment) 'add the attachment does not work the
attachment does not get added when I send the mail I get an object not
created error caused by the attachments I tried to add.

What would be the correct syntax?

I've seen Dim attachment As New MailAttachment(Server.MapPath("test.txt"))
'create the attachment but I think that only works for asp pages in my app
in winforms I get Server is not defined.

I had this stuff working OK in framework 2 and vs2005 but because of
limitations imposed by another third party I'm stuck with framework1.1

Thanks for any help

BOB


Nov 28 '06 #1
1 1024
Robert,

With SMTP their should not be a difference for version 1.1 or 2.0 mostly it
is the IIS SMTP server where is the problem.

Cor

"Robert Dufour" <bd*****@sgiims.comschreef in bericht
news:eW**************@TK2MSFTNGP06.phx.gbl...
In a windows form app the code I got is
Dim AttachItem As String

If MailAttachments <"" Then 'The fully qualified paths of all the files
that I want to attach

Dim delimStr As String = ";"

Dim delimiter As Char() = delimStr.ToCharArray()

Dim split As String() = Nothing

split = MailAttachments.Split(delimiter)

For Each AttachItem In split

Dim attachment As New MailAttachment(AttachItem) 'create the attachment

mailMsg.Attachments.Add(attachment) 'add the attachment

Next AttachItem

End If

The line

mailMsg.Attachments.Add(attachment) 'add the attachment does not work the
attachment does not get added when I send the mail I get an object not
created error caused by the attachments I tried to add.

What would be the correct syntax?

I've seen Dim attachment As New MailAttachment(Server.MapPath("test.txt"))
'create the attachment but I think that only works for asp pages in my app
in winforms I get Server is not defined.

I had this stuff working OK in framework 2 and vs2005 but because of
limitations imposed by another third party I'm stuck with framework1.1

Thanks for any help

BOB


Nov 29 '06 #2

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

Similar topics

2
by: S_p_ike | last post by:
Hi all, I have a problem with mail with attachments. To send e-mail with attachments from a form, I use Setec Astronomy's libmail class (v 1.4) (available here http://www.phpclasses.org/) ...
0
by: John P | last post by:
Hello, I'm building email messages and attachments via the JavaMail API, which are then sent via sendmail. The attachments are mime attachments of type "application/octet-stream". They are...
3
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...
2
by: Osiris Sawiris | last post by:
I inherited an Inventory control application that updates the stock from the branches at the end of each day. We receive the stock transactions via e-mail attachments (Excel Sheets). Those...
1
by: Trond A. S. Andersen | last post by:
Hi all, I'm working on a project in which i need to send mail attachments in the form of Excel documents from a .NET C# application. I've written a class which creates the Excel document using...
2
by: Brad | last post by:
I have a web .Net app which sends emails with attachments. After the email is sent I clean up aftermyself and delete the attachments from disk. In upgrading to .Net 2 I changed the email logic...
0
by: bambi | last post by:
I am facing issues while adding attachments in an E-mail via Mapisend. The code I use is below. If I try to send , I am getting error messgae in Mailmessage.12. Mailmessage.12 is expected as numeric,...
3
by: Mufasa | last post by:
Does anybody have any code that would go out to an e-mail account (I'm using g-mail), get the e-mails and if there are any attachments, get those and save them on the local hard drive? I don't...
1
by: budyerr | last post by:
All, I am trying to build a email submission form using asp.net. I currently have a web form page that will upload to my webhosting server, attach to email then delete the file after sending. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.