Results 1 to 16 of 16

Thread: [RESOLVED] how send email in vb

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Resolved [RESOLVED] how send email in vb

    hello everybody

    how can i send an email without outlook?

    there is some code?
    i've seen the other thread but i didn't find what i'm looking for.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how send email in vb

    This will use whatever the default mail client is.
    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    2. (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    3. ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    4.  
    5. Private Const SW_SHOWNORMAL = 1
    6.  
    7. Private Sub Command1_Click()
    8. Dim MailMe As String
    9. MailMe = "mailto: [email][email protected][/email]"
    10. ShellExecute Me.hWnd, "open", MailMe, vbNullString, vbNullString, SW_SHOWNORMAL
    11. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: how send email in vb

    but this code send an email via browser
    i want to send an email directly from vb

    for ex.:
    ____________
    | Send email |
    on click

    from="[email protected]"
    to="[email protected]"
    object="ciao"
    msg="ciao"

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how send email in vb

    Quote Originally Posted by 12345
    but this code send an email via browser
    i want to send an email directly from vb

    for ex.:
    ____________
    | Send email |
    on click

    from="[email protected]"
    to="[email protected]"
    object="ciao"
    msg="ciao"
    Browser What do you mean? If I run that code from a VB program, it opens and creates a new mail message based on what my default mail program is. It is nothing to do with a browser.

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: how send email in vb

    for browser, i mean internet explorer
    that code open a new window of internet explorer
    and then i can write a mail

    instead i want to do a program
    that allow to write sender, recipient, object, body
    and then send the email

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how send email in vb

    Quote Originally Posted by 12345
    for browser, i mean internet explorer
    that code open a new window of internet explorer
    and then i can write a mail
    Not on any machine I've tried it on.

    I have access machines on which the default mail is standard Outlook and other machines on which the default mail is Lotus Notes. When I run that code, it opens whatever the machines default mail package is. Is does nothing with IE.

    What is the default mail program on your machine?

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: how send email in vb

    my default is Hotmail. But i don't want to do in this way.

    i've seen a thread where there was a program: fake mailer
    but it doesn't work

    i want to do a program similar to that one

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how send email in vb

    Quote Originally Posted by 12345
    my default is Hotmail.
    Oh....that is why it opens IE on your machine.
    Quote Originally Posted by 12345
    i've seen a thread where there was a program: fake mailer but it doesn't work.

    i want to do a program similar to that one
    You want to write your own email program?

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: how send email in vb

    yes.

    i've found 2 components: MAPImessages, MAPIsession

    i want to know if those one work also without outlook.


    excuse my english, i'm italian

  10. #10

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: how send email in vb

    i've tryed mapi component

    but when i send email
    since i use hotmail, it ask to type username and password
    so i must create a new session?

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how send email in vb

    Quote Originally Posted by 12345
    i've tryed mapi component

    but when i send email
    since i use hotmail, it ask to type username and password
    so i must create a new session?
    Yes. When using any password protecting email system, you would have to supply the necessary credentials.

    BTW: MAPI is a Microsoft protocol (the M stands for Microsoft), so in all likelyhood, it would be tied to Outlook. (I say "in all likelyhood" because I've never attempted to write my own email system before, so I could be wrong, but I don't think so.)

  12. #12
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: how send email in vb

    Try this. Make sure you read the text file, if you have a dsl system.

    http://vbforums.com/attachment.php?attachmentid=39531

    193 people have downloaded version 2, so you can bet that it works. Hotmail may prevent you from relaying the mail off of your server, though. If you have a high speed connection, use their mail instead.

  13. #13

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    36

    Re: how send email in vb

    anyone know a smtp server address that work?

    else i can't try the program

  14. #14
    Lively Member
    Join Date
    Mar 2005
    Posts
    86

    Re: how send email in vb

    How do you specify a subject, message etc.. using the winAPI method?

  15. #15
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: how send email in vb

    Quote Originally Posted by 12345
    anyone know a smtp server address that work?

    else i can't try the program
    Did you read the text file that I included? Some ISP's require you to use your real user name when sending email. You can use any smtp server, as long as you use your user name. I tried that code again, and it worked fine for me.

  16. #16
    Lively Member
    Join Date
    Mar 2005
    Posts
    86

    Re: [RESOLVED] how send email in vb

    I meant the api method by Hack. Its the second reply...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width