Results 1 to 8 of 8

Thread: Send Email

  1. #1
    Guest

    Post

    May I know how to use Visual Basic 6.0 to send email? Can Show any example?

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    By far the easiest way (if not the neatest) to start a new e-mail message is

    X = Shell("START mailto:[email address]",0)

    This starts whatever e-mail client you have on your machine with a new e-mail to the email address entered.

    However, if you want to send e-mails automatically with content etc you will need to get to grips with the MSMAPI control (find it on the Components form in VB) - this is a complete ***** at the best of times so refer to the help lots..

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    Further to this I have now posted my E-Mail functions to www.PlanetSourceCode.Com/vb - if you look under "Newest Code" you will see BuzMail.. this may help.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  4. #4
    New Member
    Join Date
    Sep 2000
    Location
    Oxford
    Posts
    3

    Angry

    Hi all,

    I'm in the midst of writing an application which is basically a questionnaire. It emails the answers at the end to a couple of set email addresses in the form of an attachment. Now, the problem is this. I need to support a windows platform (NT, 95, 98, 2000) but also ones which haven't had the exchange client installed (which comes with Outlook 2000 I believe). It's proving a nightmare.

    The reason this is a reply is that I've read several of these questions and answers and they all suggest either MailTo or the Mapi controls. I've found that the MAPI controls won't work unless you have profiles installed on your machine, i.e. Exchange Client, and 98 (for instance) doesn't use profiles unless this is installed, it uses accounts. The MAPI controls don't seem to work with this setup.

    So they solve the problem some of the time, but not all. MailTo would be ok if you could send attachments with it. I've not figured this out yet either! The MAPI controls would be ok if they weren't different for each operating system. I've got Installshield Express and the merge objects don't cope with this! Dag nam it! Again this also seems to have problems sometimes if you don't use profiles.

    Anyone got any ideas? I can't connect to an SMTP server through Winsock because this doesn't always work and you can't tell if it's worked!

    Oh I neglected to mention that this has to be automatic with no user interaction with a mail client! This might all be a tall order!! Any ideas and I'd be well chuffed.

    If anyone has any ideas please let me know. Desperation is setting in!

    Thanks,
    WaveyDavey
    Three thing are certain:
    Death, taxes and lost data.
    Guess which one has occurred

  5. #5
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425
    Again, here is my ususal reply to such posts. Check out http://www.dart.com, and their kick ass SMTP/POP controls.

  6. #6
    New Member
    Join Date
    Sep 2000
    Location
    Oxford
    Posts
    3

    Cool

    Thanks CyberSurfer, I'm downloading the trial as we speak. The only problem here might be licensing in that this will be a win32 application distributed via CD (or whatever) to loads of clients, so the licensing costs might be high (and no doubt highly unacceptible to the astute businessman I'm writing this stuff for!).

    I'll give it a go though. Any other ideas greatly appreciated!

    Wavey Davey
    Three thing are certain:
    Death, taxes and lost data.
    Guess which one has occurred

  7. #7
    Guest
    If you've already done a lot of work on this project then ignore this post.

    The best way to do questionnaire/survey work is almost always through a browser. Whether it's internet or intranet, it's a very simple matter to let the client's HTML page post to an asp, cold fusion, php, or some kind of script to send the email. (after all, this is what these systems are designed for). If VB is going to send it by email, then you're already presuming that the user has an internet (or some type of network) connection. Why not let a central server do the work? This also lets you add questions down the road, show the user results, and so forth...

    Since you're doing a CD application, just shell the user's browser. If you want to minimize the user's connection time, then store the HTML on the CD and put the full URL in the FORM ACTION="..." tag. Otherwise, just shell the user to the web/intranet page.

    John

  8. #8
    New Member
    Join Date
    Sep 2000
    Location
    Oxford
    Posts
    3
    Ahh, sadly this is not an option. I know what you mean and it would undoubtedly have been my preference (being as I've done about four of them at work and am now developing a generic questionnaire infrastructure for my company).

    But this particular bit of software must be distrubuted to client PC's in large organisations, some of which don't have internet access, just email. The assumption is for a MAPI compliant email system, not necessarily internet (i.e. they aren't allowed a browser on their machine - harsh but true). This might not be the majority case, but I have to cater for all concerned. It's a bit of a nightmare and is causing me all sorts of grief! You're spot on with the internet solution, it's just that I can't use it.

    (By the way, before anyone suggests it, MAPI compliant email system doesn't mean they can definately use the MAPI controls (DLL's maybe, Simple MAPI or CDO - but versioning is still a pain) unless someone has a cunning way of forcing the MAPI controls to use Win98 accounts?!?!)

    Hey ho, back to the drawing board. Thanks for your help...

    WaveyDavey
    Three thing are certain:
    Death, taxes and lost data.
    Guess which one has occurred

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