Results 1 to 5 of 5

mailto with Subject

  1. #1
    umarus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    8

    mailto with Subject

    Hi, everyone!


    I am using "mailto" to send sms to multiple selected people (recipient numbers + @e-mail2sms.co.za are added to cc). But I need subject to it in form of #username,password# to be able to send sms. here is part of my code. Could someone help to include subject
    Code:
    On Error GoTo ErrorHandler
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim strSQL As String
    Dim strHyper As String
    Set db = CurrentDb
    
    
    strSQL = "SELECT * FROM Students WHERE YNMail = -1;"
    
    
    Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
    
    
    rs.MoveFirst
    
    
    strHyper = "mailto:myname@gmail.com"
    
    
    If rs.EOF Then
    GoTo runHyper
    Else
    strHyper = strHyper & "?cc="
    
    
    End If
    
    
    Do Until rs.EOF
    strHyper = strHyper & rs!Cellphone & "@e-mail2sms.co.za;"
    rs.MoveNext
    Loop

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    40,010
    What are the names of fields in the recordset?

    Doesn't strHyper need to concatenate the email address from the recordset?

    strHyper = "mailto:" & rs!address

    or

    strHyper = "mailto:" & rs!studentName & "@gmail.com"

    What is #username,password# - a variable?

  3. #3
    umarus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    8
    Thanks, code is not mine, but it works except subject.
    I can say only that onClick opens outlook: "To: myname@gmail.com", "CC: multiple phone numbers".
    Also as I get code uses field "Cellphone" and Yes/No check ("YNMail").
    Subject is not a variable but must contain hash(#), username and password which are provided by sms service.

  4. #4
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Code won't work as published - something's missing at the bottom and I can't see an Application.FollowHyperlink command anywhere.

    I don't think you have control over the subject text using this command. I suggest you use SendObject instead.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    40,010
    Here is sample code for sending email with Outlook.
    Code:
    Dim appOutLook As Outlook.Application
    Dim MailOutLook As Outlook.MailItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)
    With MailOutLook
        .BodyFormat = olFormatRichText
        .To = "email address here"
        ''.cc = ""
        ''.bcc = ""
        .Subject = "text here"
        .HTMLBody = "text here: " & Now
        ''.Attachments.add ("file name here")
        .DeleteAfterSubmit = True 'to not save in sent bin
        ''.Display
        .Send
    End With
    Never done SMS. From what I have read about SMS (text messaging to phone?), setting the subject should be same, assuming text messaging allows a subject. If the subject line is used to pass your username and password then maybe simply:
    .Subject = "#yourUSERNAME, yourPASSWORD#"

    So far, what I can gather about SMS, transmission is via a web service, usually with a fee. What part opening Outlook plays in this process is not clear to me.

    Read last post in http://social.msdn.microsoft.com/For...c-ae3b90c25d1c

    Also review http://www.tutcity.com/out/access/sm...ages.62710.htm
    Last edited by June7; 12-20-2012 at 02:36 PM.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. can your report name be sent to an email subject
    By Compufreak in forum Access
    Replies: 8
    Last Post: 11-20-2012, 02:03 AM
  2. SendReport - variable subject
    By meikke in forum Programming
    Replies: 1
    Last Post: 01-30-2012, 10:24 AM
  3. embed mailto in access sharepoint form
    By johnhoare65 in forum SharePoint
    Replies: 2
    Last Post: 12-23-2011, 02:00 PM
  4. Quick help w/ Mailto??
    By Visfire in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 07:36 AM
  5. Replies: 1
    Last Post: 06-08-2010, 11:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums