Solved

FTP & Email

Posted on 2007-03-23
4
183 Views
Last Modified: 2010-04-23
FTP and Email, in VB6 Iused to have to use a third party component to FTP text files to a site, is there an option within VB.NET 2005 to achieve this.

Also what options do I have when sending emails from within the framework?
 
0
Comment
Question by:rocky050371
4 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 18781965
FTP - Upload file
My.Computer.Network.UploadFile( _
                "File to upload", _
                "ftp://ftp-address" & _
                "/path/filename".mdb", _
                "ftp-username", "ftp-password", True, 5000)
-------------------------------------------------
email
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        If Me.funEMail("bla@zzz.com", "xxx@yyy.com", "test", "test from 2005") Then
            MsgBox("success")
        Else
            MsgBox("failed")
        End If
  End Sub

    Private Function funEMail(ByVal sFrom As String, ByVal sTO As String, ByVal sSubject As String, ByVal sBody As String)
        Try
            Dim msg As New System.Net.Mail.MailMessage
            Dim addressFrom As New System.Net.Mail.MailAddress(sFrom)
            Dim addressTo As New System.Net.Mail.MailAddress(sTO)
            msg.From = addressFrom
            msg.To.Add(addressTo)
            msg.Subject = sSubject
            msg.Body = sBody
            Dim smtp As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient
            smtp.Host = "yourhost.com"
            smtp.Send(msg)
        Catch ex As Exception ' do noting for now
            MsgBox(Err.Description)
            Return False
        End Try
        Return True
    End Function
0
 
LVL 4

Expert Comment

by:rwaldicott
ID: 19034023
you could use a .NET component for FTP

http://www.jscape.com/sftpdotnet/

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now