Results 1 to 10 of 28

Thread: Automatic sort due date and send email

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi Thai,
    Quote Originally Posted by Thai
    So far, I didn't change anything on your VBA code. I just follow your instruction to test out the code to make sure it send email to my work and gmail. It is working find when i go to Visual basic and hit F5 to run the test code.
    So I guess now we can move forward with the code
    This is email is good now.
    Yes you are correct the code is successful sending email (by click on F5 run) to my xxxxxx.com , company Email address and our shared gmail.
    Please just discard my last question, Everything is working fine now.
    Now we can move forward to adding subject and body message on the email and remove the test function out of the code.
    I am still not quite understanding exactly what you tell me
    I expect you may have difficulty understanding English
    I was still waiting for some information regarding what you have done regarding testing the code with an Outlook account as the Sender

    As I mentioned , I have no experience with Outlook. I understood originally that your final requirement was to use an Outlook account as the Sender ( …. "sendusername") = )
    I have not been able to get any answers I can understand from you about that.

    So I did some research and further experiments.
    This is the results of my research and further experiments.

    I did some searches on the Internet:
    https://www.startpage.com/do/search?...mail&pl=chrome
    http://lmgtfy.com/?q=Outlook+free+EMail+register
    OutlookEMailSearch.JPG : https://imgur.com/dPbRfMR

    I arrived here:
    OutlookEMailSearched.JPG : https://imgur.com/d9hQbXQ

    To my surprise, I see I can register an Email account with Outlook, without having Microsoft Outlook installed on my computer.
    So I registered a new account for us to share
    Excel Learning EMail account.JPG : https://imgur.com/7EWQ9q7

    Username : Excel Learning

    "sendusername" : "excellearning@outlook.de"
    Password ( “sendpassword” ) : xxxxxxxxxxx --- I can give this to you privately

    I have seen this:
    Settings EMailSynchronising.JPG : https://imgur.com/m3kCAy8
    Settings ShowAllSettings.JPG : https://imgur.com/fSt3ZjY
    SMTP Settings.JPG : https://imgur.com/b0AF1RK

    But
    I have tried unsuccessfully to get the code to work with this Email account as the sender.
    OhBollox.JPG : https://imgur.com/LTrrJOi
    I have no idea how to proceed with the Theme of using my code with an Outlook Email account
    I will give up for now with Outlook



    So I will leave the Outlook Theme aside for now. I give up here. I do not know how to get the code working with excellearning@outlook.de as Sender

    _._________________________


    In a few days I will continue to try and help and move forward with removing the test date and adding subject and body message etc..

    I will post again in a few days.

    For now I will remain with our shared gmail account as the Sender.
    .Configuration(LCD_CW & "sendusername") = "excellearning12@gmail.com"



    Alan
    Last edited by DocAElstein; 06-01-2018 at 03:11 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

  2. #2
    Junior Member
    Join Date
    Apr 2018
    Posts
    23
    Rep Power
    0
    Hi Alan,
    Please ignore the outlook email. I will work on that part by myself. Beside that everything on your code is working fine. I did try out your code and it did send a notification to my work email and our share email too. It is working good.

    So I believe we should move forward to removing the test date and adding subject and body message and hyperlink to the template. Please send me the new template through out share email. Thanks.

    Just one last concern, With your code. Does it check column G, I and K for due date?

    just an example of OUtlook code I used in the past.
    Dim OutApp As Object
    Dim OutMail As Object
    Dim fileName As String
    Dim mSubject As String
    Dim signature As String
    Dim fname As String
    Dim mBody As String
    Dim rng As Range
    Dim rng1 As Range
    Dim ws As Worksheet
    Dim mailTo As String
    fname = ws.Range("A1")
    mSubject = "Equipment" & " For " & Range("A1").Value
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    'mBody = "Z:\2\Form\\Manufacturing Order.xlsm"

    Dim Path As String
    ws.Protect ("Equipment")
    Path = "\\Equipment- Maint RecordsThai1.xlsm"
    mBody = "<font size=""3"" face=""Calibri"">" & _
    "Dear Team,<br><br>" & _
    "Please open the file from below link and change the date on the respective cell after you completed your task.<br><B>" & _
    fileName & ".xlsm" & "</B> is created.<br>" & _
    "Click on this link to open the file : " & _
    "<A HREF=""file://" & Path & fileName & ".xlsm" & _
    """>Files are saved here</A>" & "-->" & Range("A1").Value & _
    "<br><br>Best Regards," & _
    "<br><br></font>"

    With OutMail
    .display
    End With
    signature = OutMail.body
    With Application
    .EnableEvents = False
    .ScreenUpdating = False
    End With
    Last edited by Thainguyen; 06-01-2018 at 07:34 PM.

  3. #3
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi Thai,
    Thanks for reply and info…
    _.________________________________________________ ___________________

    Please try to use code tags when posting codes in Forum Posts:
    http://www.excelfox.com/forum/showth...0690#post10690
    http://www.excelfox.com/forum/showth...0700#post10700

    _.________________________________________________ _________________________

    Quote Originally Posted by Thainguyen View Post
    Just one last concern, With your code. Does it check column G, I and K for due date?
    Yes: This code line checks for that in 3 columns, G I and K
    ____If arrIn(Rw, 7) = TdyDbl + 3 Or arrIn(Rw, 9) = TdyDbl + 3 Or arrIn(Rw, 11) = TdyDbl + 3
    __________G_____________________________I_______________________________K

    That code line checks to see if the dates in the columns are = (Today's date + 3 days)
    Code:
            If arrIn(Rw, 7) = TdyDbl + 3 Or arrIn(Rw, 9) = TdyDbl + 3 Or arrIn(Rw, 11) = TdyDbl + 3 Then
    ' check  for criteria in  Today  + 3 days             Today  + 3 days               Today  + 3 days
    ' check in  column G                 Or    column I               Or    Column  K
    ' check in  column 7                 Or    column 9               Or    Column  11
    arrIn(Rw, 7) holds Column G .Value2
    arrIn(Rw, 9) holds Column I .Value2
    arrIn(Rw, 11) holds Column K .Value2

    ( Excel holds dates as a number : https://bettersolutions.com/excel/da...ates-times.htm
    .Value2 for 3rd January, 1900 is _ 3
    .Value2 for Saturday, 2nd June 2018 is 43253

    If today is Saturday, 2nd June 2018, then _ Let TdyDbl = CLng(Now()) = 43253

    This will always give 43253: Let TdyDbl = CLng(DateSerial(2018, 6, 2)) = 43253

    This will always give 43255 : Let TdyDbl = CLng(DateSerial(2018, 6, 4)) = 43255 (Monday, 4th June, 2018 )
    )


    _.________________________________________________ ___________________________________

    Quote Originally Posted by Thainguyen View Post
    ... I believe we should move forward to removing the test date and adding subject and body message and hyperlink to the template.
    Yes, I agree.
    Much of the information you need is already in this Thread.
    But in a few days I will post again and explain with some examples the current and next codes.

    So, I will post some more information in a few days


    Alan
    Last edited by DocAElstein; 06-04-2018 at 12:57 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 1
    Last Post: 06-28-2014, 11:31 AM
  2. Find the value of the due date falls between two dates
    By mahmoud-lee in forum Excel Help
    Replies: 2
    Last Post: 03-14-2014, 10:48 AM
  3. Replies: 4
    Last Post: 02-03-2014, 07:01 PM
  4. Replies: 1
    Last Post: 11-20-2013, 09:14 AM
  5. Replies: 2
    Last Post: 05-23-2013, 08: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
  •