انتقل إلى المحتوى الرئيسي

كيفية إرسال بريد إلكتروني بسرعة بناءً على التاريخ في خلية Excel؟

هل سبق لك أن حاولت إرسال بريد إلكتروني بناءً على التاريخ في خلية Excel؟ على سبيل المثال ، فيما يلي قائمة بالتواريخ في العمود A ، ثم تريد إرسال بريد إلكتروني بالموضوع ونص الرسالة إلى مستلم (يمكن أيضًا CC و BCC للآخرين) ، كيف يمكنك التعامل معه؟

أرسل بريدًا إلكترونيًا بناءً على التاريخ باستخدام VBA


أرسل بريدًا إلكترونيًا بناءً على التاريخ باستخدام VBA

لإرسال بريد إلكتروني استنادًا إلى التاريخ في Excel ، يمكنك فقط تطبيق رمز ماكرو.

1. قم بتمكين الورقة التي تحتوي على البيانات والتاريخ الذي تستخدمه ، ثم اضغط على ALT + F11 مفاتيح لتمكين ميكروسوفت فيسوال باسيك للتطبيقات نافذة.

2. انقر إدراج > وحدة، والصق الكود أدناه في البرنامج النصي الفارغ. 

فبا: إرسال حسب التاريخ

Sub email()
'UpdatebyExtendoffice20170831
    Dim xRg As Range
    Dim xRgEach As Range
    Dim xAddress As String
    Dim xEmail_Subject, xEmail_Send_From, xEmail_Send_To, xEmail_Cc, xEmail_Bcc, xEmail_Body As String
    Dim xMail_Object, xMail_Single As Object
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Select a range:", "KuTools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    For Each xRgEach In xRg
        If xRgEach.Value = Date Then
            xEmail_Subject = Application.InputBox("Subject: ", "Kutools", , , , , , 2)
            xEmail_Send_From = Application.InputBox("Send from: ", "KuTools For Excel", , , , , , 2)
            xEmail_Send_To = Application.InputBox("Send to: ", "KuTools For Excel", , , , , , 2)
            If xEmail_Send_To = "" Then Exit Sub
            xEmail_Cc = Application.InputBox("CC: ", "KuTools For Excel", , , , , , 2)
            xEmail_Bcc = Application.InputBox("BCC: ", "KuTools For Excel", , , , , , 2)
            xEmail_Body = Application.InputBox("Message Body: ", "KuTools For Excel", , , , , , 2)
            Set xMail_Object = CreateObject("Outlook.Application")
            Set xMail_Single = xMail_Object.CreateItem(0)
            With xMail_Single
                .Subject = xEmail_Subject
                .To = xEmail_Send_To
                .cc = xEmail_Cc
                .BCC = xEmail_Bcc
                .Body = xEmail_Body
                .Send
            End With
        End If
    Next
End Sub

3. انقر يجري زر أو اضغط F5 مفتاح لتنفيذ التعليمات البرمجية ، ينبثق مربع حوار لتذكيرك بتحديد قائمة التاريخ. انظر لقطة الشاشة:
إرسال المستند حسب التاريخ 1

4. انقر فوق "موافق" ، واستمر في تحديد موضوع البريد الإلكتروني ، وعنوان البريد الإلكتروني للمرسل ، وعنوان البريد الإلكتروني للمستلم ، و CC ، و BCC ، ونص الرسالة. انظر لقطة الشاشة:

إرسال المستند حسب التاريخ 2 حق السهم إرسال المستند حسب التاريخ 3 حق السهم إرسال المستند حسب التاريخ 4
        السهم لأسفل
إرسال المستند حسب التاريخ 7 سهم اليسار إرسال المستند حسب التاريخ 6 سهم اليسار إرسال المستند حسب التاريخ 5

5. انقر OK > OK حتى آخر مرة ، ثم تم إرسال البريد الإلكتروني.
إرسال المستند حسب التاريخ 8

ملحوظة: يجب أن يكون عنوان البريد الإلكتروني الخاص بالمرسل هو الحساب الافتراضي في Outlook الخاص بك.


إنشاء قائمة بريدية وإرسال رسائل البريد الإلكتروني

doc إرسال بريد إلكتروني

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
When I click run the date an I am asked to select a range nothing happens after I click ok?
This comment was minimized by the moderator on the site
Hi, jason, you need to select a cell or range that contains date(s), if the selected cell or range is empty or not contains date(s), the macro will exit.
This comment was minimized by the moderator on the site
Hi,


That is perfect, but when I add or change a date, it wont send the email Automatiklicht, I have to run the code again and by that I have to choose date range, sender, receiver and all info again. is there anyway to solve this issue?
This comment was minimized by the moderator on the site
its not going on next xRgEach if i am having same dates multiple times, its sending mails to same user multiple times.
This comment was minimized by the moderator on the site
Hi, vaibhav, you can remove the duplicate times by using Remove Duplicates feature in Data Tools under Data tab, then using the VBA.
This comment was minimized by the moderator on the site
Çok teşekkür ederim..
This comment was minimized by the moderator on the site
Merhaba, bir excel dosyasında hatırlatıcı olarak bu konuyla ilgili VSB nin nasıl yapıldığı ile ilgili bilgiye ihtiyacım var. Örneğin boş bir hücreye bilgi girildiğinde bana mail at ya da 3 hafta sıklıkla hücreye bilgi girilip girilmediğiyle alakalı bana bilgi ver.

Hertürlü bilgi ve kaynağa açığım. Şimdiden herkese teşekkür ederim..
This comment was minimized by the moderator on the site
Hi, Mehmet, here is a tutorial How To Send Email If A Certain Cell Is Modified In Excel? that talking about sending an email with the excel file as attachment if the cells in the specific range are modified, which may help you.
This comment was minimized by the moderator on the site
Bonjour j'ai copié les codes, à la validation il me demande bien les cellules concernées, mais lorsque que je valide, il ne me propose pas la suite des fenêtres, sujets, adresses etc
This comment was minimized by the moderator on the site
Hi, boutry, sorry I that reply with English since I do not know French. May I know your date time format? I guess maybe the code only work for datetime in English date format.
This comment was minimized by the moderator on the site
The boxes do not automatically populate after I hit OK. Where do I change the subject, email address and body of the email in the code?
This comment was minimized by the moderator on the site
holagracias por tu ayuda...tengo una consulta.....en la formula Set xRgDate = Application.InputBox("Please select the due date column:", "KuTools For Excel", , , , , , 8), el 8 que significa?
This comment was minimized by the moderator on the site
Felicidades por el material; pero no me funciona. Al parecer el Rango no se llena, por ende queda vacío y sale de la rutina.

Alguna corrección ?
This comment was minimized by the moderator on the site
This is close to what I need but I am stuck with two problems. 1st I need to run this across my entire workbook that gets new worksheets added daily. 2nd I need it to include the worksheet name in the email so I will know which sheet is due. I create new tickets (worksheets) with a field that is a future date, when that day arrives I need an email. Thank you for your help.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations