Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > sending a mail just using VB


Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2002, 01:52 PM
ccb
Guest
 
Posts: n/a
Default sending a mail just using VB


how can i send an email to an email-account just by using VB/API or whatever.... kind of simple outlook-express-clone...
???
Reply With Quote
  #2  
Old 01-15-2002, 01:54 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,887
Default

You could, for a start, have a look at the example project VBMail to be found in the vb samples directory, under misc.
Reply With Quote
  #3  
Old 01-15-2002, 01:55 PM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default re: ccb

winsock and smtp (simple mail transport protocol).
Reply With Quote
  #4  
Old 01-15-2002, 06:13 PM
Robby's Avatar
Robby Robby is offline
Code Factory

Retired Moderator
* Expert *
 
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
Default

MAPI is quite easy, here's a sample...you will need to insert mapiSession and mapiMessage on your form ( component = MAPI 6.0)
Code:
Private Sub Command1_Click()
    Dim ms As MAPISession
    Set ms = MAPISession1
    Dim mm As MAPIMessages
    Set mm = MAPIMessages1

    Dim AttachPath As String
    Dim AttachFileName As String
    Dim nSessionID As Long

    With ms
        .NewSession = True
        .DownLoadMail = False
        .SignOn
        nSessionID = .SessionID
    End With


    With mm
        .SessionID = nSessionID
        .Compose
        .RecipDisplayName = "DisplayNameTo"
        .RecipAddress = "EmailAddressTo@hotmail.com"
        .MsgSubject = "Subject"
        If AttachFileName <> "" And AttachPath <> "" Then
            .AttachmentPathName = AttachPath & AttachFileName
            .AttachmentName = AttachFileName
        End If
        .MsgNoteText = "EmailBody"
        .Send False
        
    End With

    ms.SignOff

End Sub
Reply With Quote
  #5  
Old 02-21-2002, 10:13 PM
Wormlett
Guest
 
Posts: n/a
Default

how do i get that component or watever??


Qoute:
MAPI is quite easy, here's a sample...you will need to insert mapiSession and mapiMessage on your form ( component = MAPI 6.0)
Reply With Quote
  #6  
Old 02-21-2002, 10:14 PM
orufet's Avatar
orufet orufet is offline
Paranoid Coder

Retired Leader
 
Join Date: Mar 2001
Location: Canada
Posts: 2,716
Default

Project menu >> Components
Reply With Quote
  #7  
Old 02-22-2002, 03:03 AM
divil's Avatar
divil divil is offline
Funky Monkey

* Expert *
 
Join Date: Nov 2001
Location: England
Posts: 1,289
Default

I dislike MAPI. I suggest the same thing as reboot did, using winsock (control or API) and learning the SMTP protocol (very easy).

If you want to send anything other than the most simple of emails (like HTML, or attachments) you'll have to learn how to MIME encode too.
__________________
MVP, C#
Now you see why evil will always triumph - because good is dumb.
Windows Forms and WPF user interface controls
Reply With Quote
  #8  
Old 02-22-2002, 07:15 AM
ChiefRedBull's Avatar
ChiefRedBull ChiefRedBull is offline
ISearchGoogle

Retired Moderator
* Expert *
 
Join Date: May 2001
Location: england
Posts: 6,321
Default

SMTP is easy.... and even better - there's a ready made component ready for you to drag and drop into your project in the Code Library. Its on a plate for you...

POP3 is pretty simple too for receiving mails, but MIME is hard. I guess it needs to be learnt though, if you're gonna take emailing seriously.
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->