Ana içeriğe atla

Excel'deki e-posta gövdesine belirli bir aralığı kopyalayıp yapıştırarak e-posta nasıl gönderilir?

Çoğu durumda, Excel çalışma sayfasındaki belirli bir içerik aralığı e-posta iletişiminizde yararlı olabilir. Bu makalede, doğrudan Excel'de e-posta gövdesine yapıştırılan belirli aralıklarla bir e-posta gönderme yöntemi tanıtacağız.

Excel'de e-posta gövdesine yapıştırılmış belirli bir aralıkta e-posta gönderin
Harika bir araçla e-posta gövdesine yapıştırılmış belirli bir aralıkta e-posta gönderin

Excel'de postalama için daha fazla öğretici ...


Excel'de e-posta gövdesine yapıştırılmış belirli bir aralıkta e-posta gönderin

Aşağıdaki VBA kodu, bir aralığı kopyalamanıza ve doğrudan Excel'de bir Outlook e-posta gövdesine yapıştırmanıza yardımcı olabilir. Lütfen aşağıdaki işlemleri yapın.

1. Çalışma sayfasında kopyalamanız gereken aralığı içerir, Ara Toplam + F11 anahtarları aynı anda açmak için Uygulamalar için Microsoft Visual Basic pencere.

2. Açılışta Uygulamalar için Microsoft Visual Basic pencere, lütfen tıklayın Tools > Referanslar aşağıda gösterilen ekran görüntüsü gibi.

3. içinde Referanslar - VBAProject iletişim kutusu, lütfen bulun ve kontrol edin Microsoft Outlook Nesne Kitaplığı seçeneğini ve ardından OK düğmesine basın.

4. tık Ekle > modül, ardından aşağıdaki VBA kodunu kopyalayıp Modül penceresine yapıştırın.

VBA kodu: Excel'de e-posta gövdesine yapıştırılmış belirli bir aralıkta e-posta gönderin

Sub Send_Email()
'Updated by Extendoffice 20200119
    Dim xRg As Range
    Dim I, J As Long
    Dim xAddress As String
    Dim xEmailBody As String
    Dim xMailOut As Outlook.MailItem
    Dim xOutApp As Outlook.Application    
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select range you need to paste into email body", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    For I = 1 To xRg.Rows.Count
        For J = 1 To xRg.Columns.Count
            xEmailBody = xEmailBody & "  " & xRg.Cells(I, J).value
        Next
        xEmailBody = xEmailBody & vbNewLine
    Next
    xEmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & xEmailBody & vbNewLine
    With xMailOut
        .Subject = "Test"
        .To = ""
        .Body = xEmailBody
        .Display
        '.Send
    End With
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

notlar:

  • 1). Lütfen e-posta gövdesini satırda değiştirin xEmailBody = "Merhaba" & vbLf & vbLf & "eklemek istediğiniz mesaj gövdesi" & vbLf & vbLf & xEmailBody & vbNewLine gerek duyduğunuz kadar.
  • 2). Lütfen e-posta alıcınızı ve konunuzu belirtin (.Kime = ve .Subject = "test") koddaki satırlar.

5. Tuşuna basın. F5 kodu çalıştırmak için anahtar. Haşhaşta Kutools for Excel iletişim kutusu, lütfen e-posta gövdesine yapıştırmanız gereken aralığı seçin ve ardından OK buton. Ekran görüntüsüne bakın:

6. Şimdi, belirtilen alıcı, konu, gövde ve seçilen Excel aralığı ile bir e-posta oluşturulur, lütfen Gönder Bu e-postayı göndermek için düğmesine basın. Gösterilen ekran görüntüsüne bakın.

not: VBA kodu yalnızca Outlook'u e-posta programınız olarak kullandığınızda çalışır.


Harika bir araçla e-posta gövdesine yapıştırılmış belirli bir aralıkta e-posta gönderin

Outlook kullanmıyorsanız ve yine de içine yapıştırılmış belirli bir aralık verileriyle doğrudan Excel'de e-posta göndermek istiyorsanız, Mailleri gönder yarar Kutools for Excel senin için. Bu özellikle, bir e-posta adresinin giden sunucusunu yapılandırmanız ve ardından gelecekte bu e-posta adresi aracılığıyla doğrudan Excel'de e-posta göndermeniz gerekir.

Başvurmadan önce Kutools for ExcelLütfen önce indirin ve kurun.

1. Öncelikle gerekli alanları içeren bir mail listesi hazırlamanız gerekmektedir.

  • İpuçları: Posta listesi en az 2 satır içermelidir ve ilk satır başlıklar olmalıdır (Excel'de iki e-posta adresine e-posta göndermek istediğinizi varsayarsak, lütfen bu iki e-posta adresini aşağıdaki ekran görüntüsü gibi "E-posta" başlığıyla yazın ).
  • Alternatif olarak, ile kolayca bir posta listesi oluşturabilirsiniz. Posta Listesi Oluşturun özelliği.

2. Verileri e-posta gövdesine ekleyeceğiniz aralığı seçin ve Ctrl + C tuşlarını kullanarak kopyalayın.

3. Tüm posta listesini seçin (başlıkları dahil edin), tıklayın Kutools Artı > Mailleri gönder. Ekran görüntüsüne bakın:

4. Sonra Mailleri gönder iletişim kutusu açılır.

  • 4.1) Seçilen posta listesindeki öğeler ilgili alanlarda doldurulur (ihtiyaç duyduğunuzda posta listesine daha fazla alan ekleyebilirsiniz);
  • 4.2) E-posta gövdesi kutusuna tıklayın, Ctrl + V Seçili aralık verilerini içine yapıştırmak için anahtarlar. Bundan sonra ihtiyacınız olan diğer içerikleri ekleyin;
  • 4.3 işaretini kaldırın. Outlook aracılığıyla e-posta gönderin Kutu;
  • 2.4) Giden Sunucu Ayarları buton. Ekran görüntüsüne bakın:

5. Sonra Giden Sunucu (SMTP) Ayarları - Yeni Şema iletişim kutusu açılır. Lütfen e-posta adresini sunucu ayarlarıyla doldurun, gönderilen tüm postaları kaydetmek için bir klasör belirtin. Gönderilmiş e-postaları şuraya kaydet: ve ardından OK düğmesine basarak ayarları kaydedin.

6. Geri döndüğünde Mailleri gönder iletişim kutusunda, Gönder E-postayı göndermek için düğmesine basın.

Artık bu özellik ile doğrudan Excel'de e-posta gönderebilirsiniz.

  Bu yardımcı programın ücretsiz denemesine (30 günlük) sahip olmak istiyorsanız, indirmek için lütfen tıklayınızve ardından yukarıdaki adımlara göre işlemi uygulamaya gidin.


İlgili yazılar:

Excel'deki hücrelerde belirtilen e-posta adreslerine e-posta gönderin
Bir e-posta adresleri listeniz olduğunu ve bu e-posta adreslerine doğrudan Excel'de toplu olarak e-posta mesajı göndermek istediğinizi varsayarsak. Nasıl başarılır? Bu makale size Excel'deki hücrelerde belirtilen birden çok e-posta adresine e-posta gönderme yöntemlerini gösterecektir.

Excel'de e-posta gönderirken Outlook imzası ekleyin
Doğrudan Excel'de bir e-posta göndermek istediğinizi varsayarsak, bu e-postaya varsayılan Outlook imzasını nasıl ekleyebilirsiniz? Bu makale, Excel'de e-posta gönderirken Outlook imzası eklemenize yardımcı olacak iki yöntem sağlar.

Excel'de birden çok ek eklenmiş e-posta gönderin
Bu makale, Outlook üzerinden Excel'de birden çok ek eklenmiş bir e-posta göndermekten bahsediyor.

Excel'de son tarih karşılandıysa e-posta gönderin
Örneğin, C sütunundaki son tarih 7 günden az veya buna eşitse (mevcut tarih 2017/9/13), A sütununda belirtilen alıcıya B sütununda belirtilen içeriğe sahip bir e-posta hatırlatıcısı gönderin başarmak mı? Bu makale, bununla ayrıntılı olarak ilgilenmek için bir VBA yöntemi sağlayacaktır.

Excel'deki hücre değerine göre otomatik olarak e-posta gönderin
Excel'de belirli bir hücre değerine göre Outlook aracılığıyla belirli bir alıcıya bir e-posta göndermek istediğinizi varsayarsak. Örneğin, bir çalışma sayfasındaki D7 hücresinin değeri 200'den büyük olduğunda, otomatik olarak bir e-posta oluşturulur. Bu makale, bu sorunu hızlı bir şekilde çözmeniz için bir VBA yöntemi sunar.

Excel'de postalama için daha fazla öğretici ...

En İyi Ofis Üretkenlik Araçları

🤖 Kutools AI Yardımcısı: Aşağıdakilere dayalı olarak veri analizinde devrim yaratın: Akıllı Yürütme   |  Kodunu oluşturun  |  Özel Formüller Oluşturun  |  Verileri Analiz Edin ve Grafikler Oluşturun  |  Kutools İşlevlerini Çağır...
Popüler Özellikler: Yinelenenleri Bul, Vurgula veya Tanımla   |  Boş Satırları Sil   |  Veri Kaybı Olmadan Sütunları veya Hücreleri Birleştirin   |   Formülsüz Tur ...
Süper Arama: Çoklu Ölçütlü VLookup    Çoklu Değer VLookup  |   Birden Çok Sayfada VLookup   |   Bulanık Arama ....
Gelişmiş Açılır Liste: Hızla Açılır Liste Oluşturun   |  Bağımlı Açılır Liste   |  Çoklu Seçim Açılır Liste ....
Sütun Yöneticisi: Belirli Sayıda Sütun Ekleme  |  Sütunları Taşı  |  Gizli Sütunların Görünürlük Durumunu Değiştir  |  Aralıkları ve Sütunları Karşılaştırın ...
Öne Çıkan Özellikler: Izgara Odağı   |  Tasarım görünümü   |   Büyük Formül Çubuğu    Çalışma Kitabı ve Sayfa Yöneticisi   |  Kaynak Kütüphanesi (Otomatik metin)   |  Tarih Seçici   |  Çalışma Sayfalarını Birleştirin   |  Hücreleri Şifrele/Şifresini Çöz    E-postaları Listeye Göre Gönder   |  Süper Filtre   |   Özel Filtre (kalın/italik/üstü çizili filtre...) ...
En İyi 15 Araç Seti12 Metin Tools (Metin ekle, Karakterleri Kaldır, ...)   |   50+ Grafik Türleri (Gantt şeması, ...)   |   40+ Pratik Formüller (Yaşı doğum gününe göre hesapla, ...)   |   19 sokma Tools (QR Kodunu Girin, Yoldan Resim Ekle, ...)   |   12 Dönüştürme Tools (Sayılardan Kelimelere, Para Birimi Dönüştürme, ...)   |   7 Birleştir ve Böl Tools (Gelişmiş Kombine Satırları, Bölünmüş hücreler, ...)   |   ... ve dahası

Kutools for Excel ile Excel Becerilerinizi Güçlendirin ve Daha Önce Hiç Olmadığı Gibi Verimliliği Deneyimleyin. Kutools for Excel, Üretkenliği Artırmak ve Zamandan Tasarruf Etmek için 300'den Fazla Gelişmiş Özellik Sunar.  En Çok İhtiyacınız Olan Özelliği Almak İçin Buraya Tıklayın...

Açıklama


Office Tab, Office'e Sekmeli Arayüz Getirir ve İşinizi Çok Daha Kolay Hale Getirir

  • Word, Excel, PowerPoint'te sekmeli düzenlemeyi ve okumayı etkinleştirin, Publisher, Access, Visio ve Project.
  • Yeni pencereler yerine aynı pencerenin yeni sekmelerinde birden çok belge açın ve oluşturun.
  • Üretkenliğinizi% 50 artırır ve her gün sizin için yüzlerce fare tıklamasını azaltır!
Comments (22)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
The only issue is that the format of the table is not maintained in the mail. Can you let me know how do we preserve the format of the table in the mail, I have the same issue, could you see if you could update it please, otherwise this is excellent.
Many thanks
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
Hi Andy Mitchell,
If you want to maintain the format of the table, the following VBA script can do you a favor. Please give it a try. Thank you.
Sub Send_Email()
'Updated by Extendoffice 20220616
    Dim xRg As Range
    Dim I, J As Long
    Dim xAddress As String
    Dim xMailOut As Object
    Dim xOutApp As Object
    On Error Resume Next
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select range you need to paste into email body", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    With xMailOut
        .Subject = "Test"
        .To = ""
        .HTMLBody = RangetoHTML(xRg)
        .Display
        '.Send
    End With
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

 ' The following VBA script is cited from this page:
 ' https://stackoverflow.com/questions/18663127/paste-excel-range-in-outlook
Function RangetoHTML(rng As Range)
' By Ron de Bruin.
    Dim fso As Object
    Dim ts As Object
    Dim TempFile As String
    Dim TempWB As Workbook

    TempFile = Environ$("temp") & "/" & Format(Now, "dd-mm-yy h-mm-ss") & ".htm"

    'Copy the range and create a new workbook to past the data in
    rng.Copy
    Set TempWB = Workbooks.Add(1)
    With TempWB.Sheets(1)
        .Cells(1).PasteSpecial Paste:=8
        .Cells(1).PasteSpecial xlPasteValues, , False, False
        .Cells(1).PasteSpecial xlPasteFormats, , False, False
        .Cells(1).Select
        Application.CutCopyMode = False
        On Error Resume Next
        .DrawingObjects.Visible = True
        .DrawingObjects.Delete
        On Error GoTo 0
    End With

    'Publish the sheet to a htm file
    With TempWB.PublishObjects.Add( _
         SourceType:=xlSourceRange, _
         Filename:=TempFile, _
         Sheet:=TempWB.Sheets(1).Name, _
         Source:=TempWB.Sheets(1).UsedRange.Address, _
         HtmlType:=xlHtmlStatic)
        .Publish (True)
    End With

    'Read all data from the htm file into RangetoHTML
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
    RangetoHTML = ts.ReadAll
    ts.Close
    RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _
                          "align=left x:publishsource=")

    'Close TempWB
    TempWB.Close savechanges:=False

    'Delete the htm file we used in this function
    Kill TempFile

    Set ts = Nothing
    Set fso = Nothing
    Set TempWB = Nothing
End Function
This comment was minimized by the moderator on the site
This worked perfectly, thank you so much.
I can now add my spin on it to get it doing what I need.
This comment was minimized by the moderator on the site
Hi Paul Johnson,

Very happy to help you solve the problem. Have a good day at work.
This comment was minimized by the moderator on the site
hello,
can you help me on below
I have create excel sheet & updated 10 supplier mail detailI have send mail through excel to all 10 supplier with individual sheet attachment with individual mail.
I want to paste excel data in outlook body instead of attachment in mail
can any one help me
This comment was minimized by the moderator on the site
Hi,
Instead of selecting the range, I want to select multiple pivots in the excel.
can you please help me.
This comment was minimized by the moderator on the site
Hi,
Instead of selecting the range manually, I want to select the range automatically.
This comment was minimized by the moderator on the site
Hi Raman,
In the below code, please replace the range "A1:C5" in line Set xRg = Range("A1:C5") with your own range.

Sub Send_Email()
Dim xRg As Range
Dim I, J As Long
Dim xAddress As String
Dim xEmailBody As String
Dim xMailOut As Outlook.MailItem
Dim xOutApp As Outlook.Application
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Range("A1:C5")
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xOutApp = CreateObject("Outlook.Application")
Set xMailOut = xOutApp.CreateItem(olMailItem)
For I = 1 To xRg.Rows.Count
For J = 1 To xRg.Columns.Count
xEmailBody = xEmailBody & " " & xRg.Cells(I, J).Value
Next
xEmailBody = xEmailBody & vbNewLine
Next
xEmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & xEmailBody & vbNewLine
With xMailOut
.Subject = "Test"
.To = ""
.Body = xEmailBody
.Display
'.Send
End With
Set xMailOut = Nothing
Set xOutApp = Nothing
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
Hi experts, Do we have updates on how the format maintained?
This comment was minimized by the moderator on the site
Hi Ther,
Can't figure it out. Sorry for that.
This comment was minimized by the moderator on the site
i am seeing a compile error (User-defined type not defined". Please help me out to overcome this.
This comment was minimized by the moderator on the site
Hi,
Please get into the Reference window by clicking Tools > references. Scroll down to find and check the Microsoft Outlook Object Library box and click the OK button to finish the setting.
This comment was minimized by the moderator on the site
this is pasting as a text. Kindly suggest how to send the table or the same format which is copied from the excel.
This comment was minimized by the moderator on the site
Code to send automatically after selecting after ok
This comment was minimized by the moderator on the site
Hi
This code is vary excellent, by using the code i have completed my 90% of my project.
I have same issue as mentioned by Anirudh that is table formatting. How can i format the table in email.
Please help me......
This comment was minimized by the moderator on the site
Good Day,
The problem can't be solved yet. Sorry for the inconvenience and thank you for your comment.
This comment was minimized by the moderator on the site
Hi, Is there any update on below.......
This comment was minimized by the moderator on the site
Hi, Also I Wanted code for "Filter by Date".
I am working on project, on that project I wanted to filter the data by the date, actually we have filter/hide the and last 05 days to current date data and we have highlight all other data.
Please help me to complete this project.
Your help is very great-full for me.
This comment was minimized by the moderator on the site
This is great. It is working as expected. The only issue is that the format of the table is not maintained in the mail. Can you let me know how do we preserve the format of the table in the mail
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