+ Reply to Thread
Results 1 to 10 of 10

Macros to send email automatically

  1. #1
    Registered User
    Join Date
    01-05-2006
    Posts
    8

    Macros to send email automatically

    I was creating a spreadsheet (forms) to collect feedback and I put a button on called "submit" to get people submit the data...

    The code is as follows:

    Sub Button1_Click()

    MsgBox "Survey Completed. Thanks a lot!"

    ActiveWorkbook.Save

    Application.Dialogs(xlDialogSendMail).Show

    End Sub


    In this way I can get the email program open automatically when people click the button.

    But Can I actually modify the code somehow and get my email address filled and send the email out automatically?

    Thanks, P

  2. #2
    Registered User
    Join Date
    02-15-2006
    Posts
    14
    Hi,

    I have a feeling it depends what e-mail system you are using, but as a starting point try the following:

    ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"

    Replace the Recipeints name and E-Mail subject with strings that meet these criteria.

    If thaat doesn't work can you let me know what E-Mail package you are using - Outlook, Lotus Notes etc.. and I can have another look at it.

    Regards,

    Adam

  3. #3
    Jim May
    Guest

    Re: Macros to send email automatically

    We use an e-mail package called Groupwise;
    What would one do in this case?
    TIA,


    "Adamaths" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > I have a feeling it depends what e-mail system you are using, but as a
    > starting point try the following:
    >
    > ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"
    >
    > Replace the Recipeints name and E-Mail subject with strings that meet
    > these criteria.
    >
    > If thaat doesn't work can you let me know what E-Mail package you are
    > using - Outlook, Lotus Notes etc.. and I can have another look at it.
    >
    > Regards,
    >
    > Adam
    >
    >
    > --
    > Adamaths
    > ------------------------------------------------------------------------
    > Adamaths's Profile:
    > http://www.excelforum.com/member.php...o&userid=31580
    > View this thread: http://www.excelforum.com/showthread...hreadid=513097
    >




  4. #4
    Registered User
    Join Date
    02-15-2006
    Posts
    14
    It should work with groupwise - I'm certain I've used the same code before with Groupwise.

    The only thing to be careful of is the way that users names are stored in groupwise - for example if you put the recipient name as Mike Smith groupwise may expect to see Smith, Mike.

    I would suggest using an external e-mail address even if using groupwise to send the mail internally.

    Regards,

    Adam

  5. #5
    Tom Ogilvy
    Guest

    Re: Macros to send email automatically

    Try it.

    --
    Regards,
    Tom Ogilvy

    "Jim May" <[email protected]> wrote in message
    news:Z1_If.182519$oG.163225@dukeread02...
    > We use an e-mail package called Groupwise;
    > What would one do in this case?
    > TIA,
    >
    >
    > "Adamaths" <[email protected]> wrote in
    > message news:[email protected]...
    > >
    > > Hi,
    > >
    > > I have a feeling it depends what e-mail system you are using, but as a
    > > starting point try the following:
    > >
    > > ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"
    > >
    > > Replace the Recipeints name and E-Mail subject with strings that meet
    > > these criteria.
    > >
    > > If thaat doesn't work can you let me know what E-Mail package you are
    > > using - Outlook, Lotus Notes etc.. and I can have another look at it.
    > >
    > > Regards,
    > >
    > > Adam
    > >
    > >
    > > --
    > > Adamaths
    > > ------------------------------------------------------------------------
    > > Adamaths's Profile:
    > > http://www.excelforum.com/member.php...o&userid=31580
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=513097
    > >

    >
    >




  6. #6
    Jim May
    Guest

    Re: Macros to send email automatically

    Thanks I'll give it a try..
    Jim

    "Adamaths" <[email protected]> wrote in
    message news:[email protected]...
    >
    > It should work with groupwise - I'm certain I've used the same code
    > before with Groupwise.
    >
    > The only thing to be careful of is the way that users names are stored
    > in groupwise - for example if you put the recipient name as Mike Smith
    > groupwise may expect to see Smith, Mike.
    >
    > I would suggest using an external e-mail address even if using
    > groupwise to send the mail internally.
    >
    > Regards,
    >
    > Adam
    >
    >
    > --
    > Adamaths
    > ------------------------------------------------------------------------
    > Adamaths's Profile:
    > http://www.excelforum.com/member.php...o&userid=31580
    > View this thread: http://www.excelforum.com/showthread...hreadid=513097
    >




  7. #7
    Jim May
    Guest

    Re: Macros to send email automatically

    Thanks Tom;
    I'm (still) always afraid that when I try something like this
    THE ENTIRE (Office) SYSTEM will go down and
    within 2 or 3 minutes I'll be surrounded by several Firemen - and/or the
    Hook and Ladder crew -- LOL
    Oh well, what the heck,, I'll try it !!
    Jim


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > Try it.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Jim May" <[email protected]> wrote in message
    > news:Z1_If.182519$oG.163225@dukeread02...
    >> We use an e-mail package called Groupwise;
    >> What would one do in this case?
    >> TIA,
    >>
    >>
    >> "Adamaths" <[email protected]> wrote
    >> in
    >> message news:[email protected]...
    >> >
    >> > Hi,
    >> >
    >> > I have a feeling it depends what e-mail system you are using, but as a
    >> > starting point try the following:
    >> >
    >> > ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"
    >> >
    >> > Replace the Recipeints name and E-Mail subject with strings that meet
    >> > these criteria.
    >> >
    >> > If thaat doesn't work can you let me know what E-Mail package you are
    >> > using - Outlook, Lotus Notes etc.. and I can have another look at it.
    >> >
    >> > Regards,
    >> >
    >> > Adam
    >> >
    >> >
    >> > --
    >> > Adamaths
    >> > ------------------------------------------------------------------------
    >> > Adamaths's Profile:
    >> > http://www.excelforum.com/member.php...o&userid=31580
    >> > View this thread:

    > http://www.excelforum.com/showthread...hreadid=513097
    >> >

    >>
    >>

    >
    >




  8. #8
    Tom Ogilvy
    Guest

    Re: Macros to send email automatically

    Sendmail is designed to use the default mail application as defined in the
    registry. If you can do File=>Send To => Mail Recipient, then it should
    work.

    --
    Regards,
    Tom Ogilvy


    "Jim May" <[email protected]> wrote in message
    news:V7%If.182523$oG.162814@dukeread02...
    > Thanks Tom;
    > I'm (still) always afraid that when I try something like this
    > THE ENTIRE (Office) SYSTEM will go down and
    > within 2 or 3 minutes I'll be surrounded by several Firemen - and/or the
    > Hook and Ladder crew -- LOL
    > Oh well, what the heck,, I'll try it !!
    > Jim
    >
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try it.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Jim May" <[email protected]> wrote in message
    > > news:Z1_If.182519$oG.163225@dukeread02...
    > >> We use an e-mail package called Groupwise;
    > >> What would one do in this case?
    > >> TIA,
    > >>
    > >>
    > >> "Adamaths" <[email protected]> wrote
    > >> in
    > >> message news:[email protected]...
    > >> >
    > >> > Hi,
    > >> >
    > >> > I have a feeling it depends what e-mail system you are using, but as

    a
    > >> > starting point try the following:
    > >> >
    > >> > ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"
    > >> >
    > >> > Replace the Recipeints name and E-Mail subject with strings that meet
    > >> > these criteria.
    > >> >
    > >> > If thaat doesn't work can you let me know what E-Mail package you are
    > >> > using - Outlook, Lotus Notes etc.. and I can have another look at it.
    > >> >
    > >> > Regards,
    > >> >
    > >> > Adam
    > >> >
    > >> >
    > >> > --
    > >> > Adamaths
    > >>

    > ------------------------------------------------------------------------
    > >> > Adamaths's Profile:
    > >> > http://www.excelforum.com/member.php...o&userid=31580
    > >> > View this thread:

    > > http://www.excelforum.com/showthread...hreadid=513097
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




  9. #9
    Registered User
    Join Date
    01-05-2006
    Posts
    8

    Thumbs up Thanks, it works

    Thanks Adam,

    It is working in my Outlook. However I am getting a pop-up saying "some programs is trying to send email on behalf of you.... " with YES/NO options while click yes to send out the email with the spreadsheet attached...

    Any ways to modify the text on the pop-up to make it more friendly?

    Cheers, P



    Quote Originally Posted by Adamaths
    Hi,

    I have a feeling it depends what e-mail system you are using, but as a starting point try the following:

    ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"

    Replace the Recipeints name and E-Mail subject with strings that meet these criteria.

    If thaat doesn't work can you let me know what E-Mail package you are using - Outlook, Lotus Notes etc.. and I can have another look at it.

    Regards,

    Adam

  10. #10
    Jim May
    Guest

    Re: Macros to send email automatically

    I gave it a try (at work).
    The macro paused along the way (a couple of times
    asking for confirmation-type things) but it went-through,
    without incident.
    Thanks..



    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > Sendmail is designed to use the default mail application as defined in the
    > registry. If you can do File=>Send To => Mail Recipient, then it should
    > work.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Jim May" <[email protected]> wrote in message
    > news:V7%If.182523$oG.162814@dukeread02...
    >> Thanks Tom;
    >> I'm (still) always afraid that when I try something like this
    >> THE ENTIRE (Office) SYSTEM will go down and
    >> within 2 or 3 minutes I'll be surrounded by several Firemen - and/or the
    >> Hook and Ladder crew -- LOL
    >> Oh well, what the heck,, I'll try it !!
    >> Jim
    >>
    >>
    >> "Tom Ogilvy" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Try it.
    >> >
    >> > --
    >> > Regards,
    >> > Tom Ogilvy
    >> >
    >> > "Jim May" <[email protected]> wrote in message
    >> > news:Z1_If.182519$oG.163225@dukeread02...
    >> >> We use an e-mail package called Groupwise;
    >> >> What would one do in this case?
    >> >> TIA,
    >> >>
    >> >>
    >> >> "Adamaths" <[email protected]>
    >> >> wrote
    >> >> in
    >> >> message news:[email protected]...
    >> >> >
    >> >> > Hi,
    >> >> >
    >> >> > I have a feeling it depends what e-mail system you are using, but as

    > a
    >> >> > starting point try the following:
    >> >> >
    >> >> > ActiveWorkbook.SendMail "Recipients name", "E-Mail subject"
    >> >> >
    >> >> > Replace the Recipeints name and E-Mail subject with strings that
    >> >> > meet
    >> >> > these criteria.
    >> >> >
    >> >> > If thaat doesn't work can you let me know what E-Mail package you
    >> >> > are
    >> >> > using - Outlook, Lotus Notes etc.. and I can have another look at
    >> >> > it.
    >> >> >
    >> >> > Regards,
    >> >> >
    >> >> > Adam
    >> >> >
    >> >> >
    >> >> > --
    >> >> > Adamaths
    >> >>

    >> ------------------------------------------------------------------------
    >> >> > Adamaths's Profile:
    >> >> > http://www.excelforum.com/member.php...o&userid=31580
    >> >> > View this thread:
    >> > http://www.excelforum.com/showthread...hreadid=513097
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1