Send a message from a list of emails in lightswitch 2013.4 HTML screen using ajax

Hi There,
any idea how to make a button to send a message from a list of emails in lightswitch 2013.4 HTML.
my idea is to send message to all emails in the details picker (or the drop down menu or a choice list) tat is filled by SQL query (as a data source in lightswitch)
i have read many articles,  most of them were written in PHP or VB !
for example:
http://www.devarticles.com/c/a/HTML/Sending-email-with-AJAX-building-a-small-application/1/
http://stackoverflow.com/questions/22442074/how-to-send-email-to-a-list-of-addresses-from-lightswitch
http://lightswitchhelpwebsite.com/Forum/tabid/63/aft/75/Default.aspx
http://maxslabyak.com/c-sharp/using-jquery-to-send-email-with-web-services/
http://www.paulspatterson.com/microsoft-lightswitch-sending-emails-from-the-client/
http://www.quercussolutions.com/blog/index.php/microsoft-lightswitch-sending-emails/
http://www.lightswitchspecial.com/2013/01/7-most-easiest-way-to-send-email-from.html
as far as  i know, the HTML screens in lightswitch 2013 can be encoded with ajax only, not vb or C# any more!
my project contains only HTML screens, no desktop screens. i know that i can do the VB programming in the tables actions, but i am looking to have this code in the Browse screen to give me more flexibility depending on my decision to
send or not..
help please :)  

Hello Hasan,
I do this using a generic handler(e.g. sendmail.ashx). In the ashx file i use this code:
Imports System.Net.Mail
Imports System.Web
Imports System.Web.Services
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim str As String = "there was no error "
Dim Recipient As String = Convert.ToString(context.Request.Params("pRecipient"))
Dim strsub As String = Convert.ToString(context.Request.Params("pSubject"))
Dim strmsg As String = Convert.ToString(context.Request.Params("pMessage"))
Dim msg As New MailMessage
Try
' Your mail address and display name.
' This what will appear on the From field.
' If you used another credentials to access
' the SMTP server, the mail message would be
' sent from the mail specified in the From
' field on behalf of the real sender.
msg.From = New MailAddress("[email protected]", "Displayname")
' To addresses
msg.To.Add("[email protected]")
'msg.To.Add(New MailAddress("[email protected]", "Friend B"))
' You can specify CC and BCC addresses also
' Set to high priority
msg.Priority = MailPriority.High
msg.Subject = strsub
' You can specify a plain text or HTML contents
msg.IsBodyHtml = True
msg.Body = strmsg
'msg.Body = _
' "Hello everybody,<br /><br />" & _
' "I found an interesting site called <a href=""http:'JustLikeAMagic.WordPress.com"">" & _
' "Just Like a Magic</a>. Be sure to visit it soon."
' In order for the mail client to interpret message
' body correctly, we mark the body as HTML
' because we set the body to HTML contents.
' Attaching some data
' msg.Attachments.Add(New Attachment("D:\Site.lnk"))
' Connecting to the server and configuring it
Dim client As New SmtpClient()
client.Host = "mail.gmx.com"
client.Port = 25
client.EnableSsl = True
' The server requires user's credentials
' not the default credentials
client.UseDefaultCredentials = False
' Provide your credentials
client.Credentials = New System.Net.NetworkCredential("yourcredentias", "f2f081639ad")
client.DeliveryMethod = SmtpDeliveryMethod.Network
' Use SendAsync to send the message asynchronously
client.Send(msg)
Catch ex As Exception
str = ex.Message
Finally
msg.Dispose()
End Try
context.Response.ContentType = "text/plain"
context.Response.Write(str)
End Sub
When you create the ASHX then replace the ProcessRequest with the above function.
In LS HTML Screen create the function for pressing a button an appen the following text:
$.ajax({
type: 'post',
data: {
pRecipient: Screen.yourdata,
pSubject: Screen.yourdata,
pMessage: Screen.yourdata,
url: '../sendmail.ashx',
success: function success(result) {
alert(result);
This is a way you can do that. In VB and out of your browse Screen.
Hope this helps
Thomas

Similar Messages

  • Can't send audio messages from Nokia E63 to email ...

    I used to send audio messages from my mobile to my friend's email, and it worked fine.
    But some days ago it stopped working. I keep on seeing this whenever I try to send audio message.
    "In order to send/download MM messages, the current active connection may be closed (this may affect other applications in use). Do you want to continue ?"
    When I disconnected connection, it fails to send again. I saw this message:
    "Multimedia message cannot be sent. Packet data connection not available"
    It is impossible for me to send the audio message if I close the connection because I'm not having internet in my phone.
    I have been using packet data connection to send all the messages to email all the time and it went OK. I got that problem just a few days ago and I cannot send any audio messages now.
    I can still send normal emails (non-audio message) from my phone through packet data connection though.
    The problem is only when sending the audio message.
    I'm using Nokia E63 and I'm in the UAE.
    My mobile provider is "Du".
    I use packet data connection from "MyWorld"
    I don't have any other packet data connections. I had many but now, MyWorld is the only one in my phone.
    Please help me how can I do it.

    Automatic configuration.
    Your mobile will be automatically configured to access the MyWorld mobile portal when you first join du.
    You will receive an SMS message, which you should accept and save.
    You can also request for these settings by sending the following SMS message “du” to 333 or by calling Customer Care on 155.
    Availability of the MyWorld mobile portal and of the relevant settings is dependent on your handset type.
    For more information on MyWorld, call 155 from your mobile or visit us at www.du.ae
    This might do the trick.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • Why do text messages from my iPad appear to some people as if they came from my email address instead of my phone number? This does not happen when I send text messages from my iPhone.

    Why do text messages from my iPad appear to some people as if they came from my email address instead of my phone number? This does not happen when I send text messages from my iPhone.

    You need to link your iPhone number to Messages - and Facetime if you use it. For Messages go to Settings>Messages>Send and Receive at>You can be reached by iMessage at. If your phone number is showing there, select it as your Contact address. If it doesn't appear in there, take a look at the end of this article for help.
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support

  • I own osx mountain lion with messages.When i go to create a new message i dont undrestand why you can send it to their email.also is it possible to send a message from my mac to another mac that has mountain lion. MacBook, OS X Mountain Lion, help me

    I own osx mountain lion with messages.When i go to create a new message i dont undrestand why you can send it to their email.also is it possible to send a message from my mac to another mac that has mountain lion.
    MacBook, OS X Mountain Lion, help me

    The recipient needs to have Messages set up with the e-mail. Check the image below:
    Hope it heps.
    JP

  • Safari shuts down when i goto send a message from my hotmail account

    safari shuts down when i go to send a message from my hot mail account how do i fix this problem

    Can you send an email from your computer to the ePrint service?  
    If so it may be that your phone is not supported.  Here is a list of email clients that have been tested:
    Outlook 2003, 2007
    Hotmail, Yahoo! Mail, Gmail
    Apple Mail (iPhone, iPad, Macbook, MacbookPro)
    BlackBerry mail client
    Nokia/Symbian client (Nokia)
    You can change your account to locked mode from your ePrint Center.  Once you've changed it you just enter your email address on the allow list.
    Although I am not affiliated with HP, please give Kudos if I've answered your question

  • Send sms message from pc to mobile

    hi...
    what we need to send sms message from pc to mobile and how can send it ????
    plz give me step by step
    thx

    Sending an sms message from your PC can be done in many ways. Firstly this can be send via email, simply type in the to field the number followed by the gateway. for example, [email protected] There are also a number of websites that allows you to do this simple search google for "send text message" and will see a list. The one I use is [http://www.wetextfree.com] it works and its free. Hope this helps you.

  • How do i send sms messages from my mac to a phone

    the gurl from apple said i could send sms messages from my imac to a phone. How do i di that?

    Hi Lanny,
    Actually those two pics don't tell you what you need to know.
    The First is correct as it can be from the Messages app but the second goes to no way to tell you how to do and b fact does not even mention SMS messages.
    @ 10411
    You will need to have an AIM or AIM Valid name that you can add to the Messages > Preferences > Accounts at the + icon below the list.
    Next the Mac need to be in the United States.
    Go to System Preferences > Language and Text and set the Region to the Untied States.
    (In iChat this added SMS items to some of the Menus in iChat)
    The iPhone has to be on a Carrier that is in the United States   See list
    Which in turn means the phone number is a United States one (+1 country code)
    This means you add the Cell/mobile number as if it were a Buddy to an AIM list.
    So Creating an Address Card for "SMS Test" and adding the mock number +1234567890 to that I get this in Messages  (Mousing over the Name to see the "Screen Name" which is the number in this case)
    Basically this is a feature that iChat has always had since AIM included a link to SMS to certain Phones.
    Messages does everything iChat did/does and this includes SMS Messaging via an AIM Buddy list even though in this case the Menu items has disappeared.
    AS has been said there are also other methods.
    8:24 PM      Saturday; April 6, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • When i send a message from my iphone 4 to my wifes iphone 4 they go to her and back to me also

    when i send a message from my iphone 4 to my wifes iphone 4 it sends it to her and back to me !

    Go to settings on your device. Settings, messages, send and receive. You might have her email in this area selected unmark and / or delete. You must do the same on her device. Good luck

  • I have an ipad and Iphone. I cannot send I message from my ipad to certain people and yet can from my Iphone.

    I have an ipad and Iphone. I cannot send I message from my ipad to certain people and yet can from my Iphone. Any suggestions

    You can send iMessages to other iOS devices, like iPad, iPhone, etc. Furthermore, the other iDevices users must have set up their iMessage.
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Set Up Alert Sounds
    http://www.quepublishing.com/articles/article.aspx?p=1873027&seqNum=3
    Extra FaceTime IDs
    http://tinyurl.com/k683gr4
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Fix Can’t Sign Into FaceTime or iMessage iOS 7
    http://ipadtutr.com/fix-login-facetime-imessage-ios-7/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457#19087457
    How to watch FaceTime calls on the big screen with Apple TV
    http://www.imore.com/daily-tip-ios-5-airplay-mirroring-facetime
    Send an iMessage as a Text Message Instead with a Quick Tap & Hold
    http://osxdaily.com/2012/11/18/send-imessage-as-text-message/
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    How to Receive SMS Messages on an iPad
    http://yourbusiness.azcentral.com/receive-sms-messages-ipad-16776.html
    Apps for Texting http://appadvice.com/appguides/show/apps-for-texting
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • How i can send i message from my i phone to my i pad

    how i can send i message from my i phone to my i pad

    Activate iMessage on both your phone and your iPad.  Then send an iMessage to the email address you are using for iMessage on your iPad (which is shown in Settings>Messages>Receive At).

  • How do I email a group from a list of email addresses in a pdf?

    how do I email a group from a list of email addresses in a pdf?

    Work Around:
    On your mac:
    1.  Open a new email
    2.  Insert name of an existing group into one of the "To" fields as usual.
    3.  Highlight all the resulting names in the "To" entry
         [Highlight first name, and while holding shift, highlight last name and all will highlight[]
    4. Copy (Command C) the highlighted emails
    5. Paste (Command V) nto a pages document
    6. Remove the name and anything else preceeding the first < and also the first < of only the first entry whixh will look like this:
         [email protected]>,
    7. Remove the > of the last email which will look like this:
         , Jane Doe <[email protected]
    8. Copy the entire altered list from the pages document
    9, Go to Contact Book and click + to add a new entry
    10.. Name the entry (XXX Group for iPad) or whatever you wish to call it
    11.  Paste all the copied altered list into any one of the email entry spaces
    12.  Click on "Done"
    13.  Create new email On iPad and click on + in any one of the "To" lines and search for "XXX Group for iPad"  You cannot just key in XXX Group for iPad!!!!!!!, you must use + contact search.
    14.  Enter the selected iPad contact group into the "To" line.
    15.  All the entries will now appear in the "To" line and you are good to go.
    Adding or deleting email addresses from the iPad group:
    Easiest:  Alter the original mac group in the usual way and repeat steps 1-14 above.  It seems impossible to edit within the emai line of the iPad contact entry.
    Rediculously simple once figured out.
    Happy emailling, but please send Bcc so that you don't spread your groups' email addresses all over the internet for spam, viruses, and other unwanted emails.  Be considerate and ask your recipients to notifiy you if they wish to be deleted from the lists you compose.

  • Regarding text messaging, if I send a message from my iPhone, the reply goes to my ipad, or mini ipad. How can I fix this?

    Regarding text messaging, if I send a message from my iPhone, the reply goes to my ipad, or mini ipad. How can I stop this from happening?

    Go to Settings/ Messaging/ Send & Receive on each device to set the contact points to be reached at, and to set the "from" address when you start a new message.  It sounds like your iPhone might be sending messages out as one thing (e.g. an iCloud address) but set to not receive replies only to your phone number.  Make sure you review settings on each device since you may, or may not, want to have them common.

  • How can I send a message from database to a J2EE application?

    How can I send a message from database to a J2EE application?
    If I have a codetable in database that has new or modified values I have to refresh the codetable in my J2EE application.
    Most effective way would be send a message to initiate a table reload from J2EE app, but I don't know how to do this.
    Now I have a background thread that regular reads the table and looks for changes.

    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_AQ_Configuration.pdf
    This document details how to create triggers on a table that send out JMS messages.
    In this example, the messages are going to Oracle BAM.. your message could go to your J2EE application listening to its own topic/queue.
    an alternative idea.
    you could also just cache your lookup table with something like Oracle Coherence and than try to ensure that all changes to the lookup go through Coherence, so that you won't need to do notification from the db up to the application. the application and the lookup data management tool would be using the data grid for management of the lookup table data, and the data grid (coherence) would persist the lookup data changes back to the db.

  • How to delete multiple email messages from my Iphone 5c; email folder?

    How to delete multiple email messages from my Iphone 5C; email folder.

    there used to be option to keep last 50,100,200 messages/emails. We need that back. This is ridiculous to delete one by one.

  • HT4623 Unable to send text message from iphone 4 to a non-iphone.

    I have just bought an Iphone 4 with ios 7.1.
    And when i am trying to send text message from my phone to a non-iphone devices it just showing a green (text background & loading bar), but still after some time the message was not getting delivered.
    As per the apple support. I have already put +91 for all my numbers even deleted & create new contacts.
    But the problem is still there.
    I have also tried to change the setting for iMessage (On/Off).
    So, please suggest.

    ​Thanks for getting back to me. I did understand that part, but didn't get
    wheather you could reply to a message you had received. I understood that
    you could not originate a new text.​

Maybe you are looking for

  • Mission Control keyboard shortcut problems

    I have a problem with my keyboard shortcuts (changing space with Mission Control) Sometimes they do not work... then I have to reset PRAM (using this guide http://support.apple.com/kb/ht1379) and then it works again. Then after some time it fails aga

  • How to decline call when the phone is not in lock screen

    Why is there no option to decline a call when it rings like for the old iOS? I need an option to decline a call, not remind me later or send a message

  • Installing Designer 6i onto Oracle 9.2.0.1.0

    I am trying to install Designer 6i on Oracle 9.2.0.1.0. The trouble is I receive an error telling something like (i'm translating from spanis into english) 'a key value for getvalue is not found' and it offers me to retry, continue or abandon. If i c

  • Downloading previous Aperture purchase to new iMac

    I purchased and downloaded Aperture on 07/02/11 to my Macbook Pro. I have an iMac now too and though it is listed as a previous purchase, it will not give me the option to redownload. How do I redownload Aperture for my iMac? I appreciate ANY assista

  • Safari 1.3.2 on OS 10.2.x ?

    For reasons lost in confusion, my G4 was found to be lacking Safari (I'm sure it used to be there...I think); I installed a copy from my wife's computer, but it won't launch. Her version is Safari 1.3.2, and when I try to open it, I get a message tha