Results 1 to 5 of 5

Thread: [2005] Problems with proccess.start("mailto:")

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2007
    Posts
    87

    [2005] Problems with proccess.start("mailto:")

    As stated above i have some trouble whith this.
    Not that it dont works but . . . . i want to be able to send a LOT of mails @ the same time under bcc.

    My code


    Code:
    Code:
    Dim counter As Integer
    Dim Tstring As String = "[email protected]"
    Do Until counter = 1000
    Tstring = Tstring + "," + "[email protected]"
    counter += 1
    Loop
    
    Toevoegen.tools.StartDefaultMail("[email protected]", Tstring)
    Where the do loop should represent the amount of email addresses


    Code:
    Code:
    Public Sub StartDefaultMail(ByVal MailTo As String, Optional ByVal BCC As String = "")
    
            Try
                Process.Start("mailto:" & MailTo & "?bcc=" & BCC)
    
            Catch e As Exception
                MsgBox("Couldn't start default email application")
    
            End Try
        End Sub
    (when i use e.message as exxeption then it gives the message: Acces denied)


    And here the startdefaultmail

    When i start the proccess with more as 150 email addresses it wont start.
    Its possible to make my own mailclient ofcourse but its quite much since it should be able to send newsletters with pictures and such things (and it must be used by computer noobs) so i prefer giving them their own mail client.

    But my problem is that i cant send that much mails @ the same time.
    Is there any solution for this?

    Greets

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Problems with proccess.start("mailto:")

    Ah, this makes me nostalgic. This was the subject of my very first post on this forum. I asked the very same question for the very same reason. I wanted to send a single e-mail with a lot of recipients.

    The issue is nothing to do with e-mail specifically. It appears that the Process.Start method doesn't accept "path" longer than just over 2000 characters. I didn't ever determine the exact maximum but I would guess 2047 or 2048. I guess when they implemented Process.Start they didn't take long mailto URLs into account. I never found a proper solution to this. You may be able to find an API function to use instead but I didn't look that far. I just broke up any recipient list that was too long and created multiple messages.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2007
    Posts
    87

    Re: [2005] Problems with proccess.start("mailto:")

    Hehehehe thats funny indeed.

    And i tried system.net.mail
    But the problem is that the user must type HTML code(no i dont gonna write my own HTML editor :P) and its not a normal way to place things like images from your mail attachment into your email message.

    Isnt it just possible to add contacts to your default mail client and then send a whole contact group a mail or something like that?

    Greets

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2007
    Posts
    87

    Re: [2005] Problems with proccess.start("mailto:")

    Ok people a new problem when i solved this.
    Instead of using "mailto" i used something else.

    Code:
     Dim oApp As New Outlook.Application
            Dim space As Outlook._NameSpace
            'Dim Folder As Outlook.MAPIFolder
    
            space = oApp.GetNamespace("MAPI")
            space.Logon(Nothing, Nothing, True, True)
    
            Dim mail As Outlook._MailItem
            mail = oApp.CreateItem(Outlook.OlItemType.olMailItem)
            mail.To = "[email protected]"
    
            Dim counter As Integer
            Dim Tstring As String = "[email protected]"
    
            Do Until counter = 10
                Tstring = Tstring + "," + "[email protected]"
                counter += 1
            Loop
    
            mail.BCC = Tstring
            mail.Body = " Hey"
            mail.Subject = " Test"
            mail.Save()
    This works great. It places the email i make in the folder "Drafts" where they can freely edit the email. But the problem is still that it is not possible to send it to a LOT of people @ the same time. So my question is. Does someone know how to get mail from your outlook into a mail inside vb(Outlook._MailItem). This is because i can send mails then to only 20 addresses as many times i want to (when i am out of addresses ofc).

    Greets

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Problems with proccess.start("mailto:")

    What you're doing is all well and good but it requires your user to have Outlook, so it won't work with any other mail client. If you know that your users will all have Outlook then that's not a problem, but if you don't know that then it's a big problem.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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