Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SendMail automation

Featured Replies

Hi,

Does anybody have a clue how to automatically send mail and close mail app (Outlook) on WinXP (SP2)?

Thx in advance

VJ

Edited by Guest

  • Author

Here is VBS for sending mail automatically witout mail app and FMP:

Set objEmail = CreateObject("CDO.Message")

objEmail.From = "[email protected]"

objEmail.To = "[email protected]"

objEmail.Subject = "xxxx"

objEmail.Textbody = "xxxx"

objEmail.AddAttachment "c:xxx"

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _

"your SMTP"

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objEmail.Configuration.Fields.Update

objEmail.Send

Q: Any Idea how to conect with FMP records?

VJ

Edited by Guest

Hi VJ,

Different ways you can do this:

- you can make an ODBC connection to FM8

- you can trigger a script in FM that will export a file and you read that file in your VBscript

- dynamically create that VBscript from inside FM using data from whatever record you're on.

This last approach is my favorite because it's fast and easy to set up.

  • Author

Danke Vim,

I have other VBS to trigger FM script to export data launched by Win Scheduled task, but FM file have SetUp layout in which end user must enter email addresses, so idea is to have mail VBS which will take email addresses from FM file (mail records) and automaticly send mail on those addresses ...

so, how to put connection with FM file in this mail VBS? :P

It depends on how this fits in your solution. I typically store the VBscript syntax in a global field, with placeholders where the FM data needs to go (where the "xxx"'s are in your example).

Then through a user action a script runs that:

- populates another global with the final VBscript syntax substituting out the placeholders with real data

- uses the "export field contents" script step to create the VBscript physically on the hard disk

- use the "send event" script step to execute it

- use another "send event" to delete the vbscript

But if the VBScript is part of another process outside of FM then this may not be possible and you'll need to use ODBC in your VBscript to extract the data from FM.

  • 3 months later...

I have vb script I use to send mail. It works great but the email gets sent automaticaly. I have a client who does not want the email sent emmediately but mabe just sent to outbox untill he hits his send and receive button or to be sent to the drafts folder. How I do I change the VB script below to make this change.

Dim App

Dim Mail

Set App = CreateObject("Outlook.application")

Set Mail = App.CreateItem(0)

Mail.To = "[email protected]"

Mail.Cc = ""

Mail.Bcc = ""

Mail.Subject = "Attached CVs"

Mail.Body = "Dear Natalie"+chr(13) _

+""+chr(13) _

+"Further to our conversation regarding the candidates for the role of , please find attached the following CVs, Natalie Rebecca Fullick."+chr(13) _

+""+chr(13) _

+"If you have any queries, please do not hesitate to contact me."+chr(13) _

+""+chr(13) _

+""+chr(13) _

+"Kind regards "+chr(13) _

+""+chr(13) _

+""+chr(13)

Mail.Send

Set Mail = Nothing

Set App = Nothing

Thanks for all the help.

Kind Regards

Kev

Just off the top of my head but replace "mail.send" with "mail.save"?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.