Solved

FTP & Email

Posted on 2007-03-23
4
178 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
Comment Utility
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
Comment Utility
you could use a .NET component for FTP

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

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

11 Experts available now in Live!

Get 1:1 Help Now