J'ai dans une BDD en colonne E des adresses mails, est t'il possible
d'envoyer un mail type à toutes mes adresses mail de la colonne E en une
seule fois.
Merci
Manu
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
MichD
Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le
nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'---------------------------------------------------------
Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1")
For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row)
Adr = Adr & C.Value & ";"
Next
Adr = Left(Adr, Len(Adr) - 1)
End With
With CreateObject("Outlook.Application")
With .CreateItem(0)
.To = Adr
.Subject = "L'objet du message"
.HTMLBody = "Le message"
'.Display ' Afficher avant d'envoyer si nécessaire
.Send
End With
End With
Application.ScreenUpdating = False
End Sub
'---------------------------------------------------------
MichD
---------------------------------------------------------------
"Manu" a écrit dans le message de groupe de discussion :
n2kfup$gtt$1@speranza.aioe.org...
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible
d'envoyer un mail type à toutes mes adresses mail de la colonne E en une
seule fois.
Merci
Manu
---
L'absence de virus dans ce courrier électronique a été vérifiée par le
logiciel antivirus Avast.
https://www.avast.com/antivirus
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
Manu
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion : n2kis1$nmp$ Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le
fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion :
n2kis1$nmp$1@speranza.aioe.org...
Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le
nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'---------------------------------------------------------
Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1")
For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row)
Adr = Adr & C.Value & ";"
Next
Adr = Left(Adr, Len(Adr) - 1)
End With
With CreateObject("Outlook.Application")
With .CreateItem(0)
.To = Adr
.Subject = "L'objet du message"
.HTMLBody = "Le message"
'.Display ' Afficher avant d'envoyer si nécessaire
.Send
End With
End With
Application.ScreenUpdating = False
End Sub
'---------------------------------------------------------
MichD
---------------------------------------------------------------
"Manu" a écrit dans le message de groupe de discussion :
n2kfup$gtt$1@speranza.aioe.org...
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible
d'envoyer un mail type à toutes mes adresses mail de la colonne E en une
seule fois.
Merci
Manu
---
L'absence de virus dans ce courrier électronique a été vérifiée par le
logiciel antivirus Avast.
https://www.avast.com/antivirus
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion : n2kis1$nmp$ Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
MichD
Dans ta question originale, tes adresses étaient dans une feuille de calcul! Pour extraire les adresses d'un carnet d'adresses... ceci n'a pas été testé je n'ai pas le temps!
'----------------------------------------------- Sub Envoi_Courriel() 'Requiert la bibliothèque suivante : 'Microsoft Outlook XX.0 Object Library 'Outils / référence / et tu coches la référence Dim Adr As String Dim olNS As Outlook.Namespace Dim i As ContactItem Dim OlApp As Outlook.Application Set OlApp = CreateObject("Outlook.Application") Set olNS = OlApp.GetNamespace("MAPI") Set Contacts = olNS.GetDefaultFolder(olFolderContacts)
Set Litems = Contacts.Items
On Error Resume Next ' Contacts incomplets For Each i In Litems If i.Email1Address <> "" Then Adr = Adr & i.Email1Address & ";" End If Next Adr = Left(Adr, Len(Adr) - 1)
With OlApp With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub Set OlApp = Nothing: Set Contacts = Nothing: Set Litems = Nothing End Sub '-----------------------------------------------
Je ne connais pas "Lotus Notes", mais tu peux débuter ta recherche par ceci :
Ceci provient du site : http://www.fabalou.com/
'Public Sub SendNotesMail(Subject as string, attachment as string, 'recipient as string, bodytext as string,saveit as Boolean) 'This public sub will send a mail and attachment if neccessary to the 'recipient including the body text. 'Requires that notes client is installed on the system. Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean) 'Set up the objects required for Automation into lotus notes Dim Maildb As Object 'The mail database Dim UserName As String 'The current users notes name Dim MailDbName As String 'THe current users notes mail database name Dim MailDoc As Object 'The mail document itself Dim AttachME As Object 'The attachment richtextfile object Dim Session As Object 'The notes session Dim EmbedObj As Object 'The embedded object (Attachment) 'Start a session to notes Set Session = CreateObject("Notes.NotesSession") 'Get the sessions username and then calculate the mail file name 'You may or may not need this as for MailDBname with some systems you 'can pass an empty string UserName = Session.UserName MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf" 'Open the mail database in notes Set Maildb = Session.GETDATABASE("", MailDbName) If Maildb.ISOPEN = True Then 'Already open for mail Else Maildb.OPENMAIL End If 'Set up the new mail document Set MailDoc = Maildb.CREATEDOCUMENT MailDoc.Form = "Memo" MailDoc.sendto = Recipient MailDoc.Subject = Subject MailDoc.Body = BodyText MailDoc.SAVEMESSAGEONSEND = SaveIt 'Set up the embedded object and attachment and attach it If Attachment <> "" Then Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment") Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment") MailDoc.CREATERICHTEXTITEM ("Attachment") End If 'Send the document MailDoc.PostedDate=Now() 'Gets the mail to appear in the sent items folder MailDoc.SEND 0, Recipient 'Clean Up Set Maildb = Nothing Set MailDoc = Nothing Set AttachME = Nothing Set Session = Nothing Set EmbedObj = Nothing End Sub
If you want to send a message to more than one person or copy or blind carbon copy the following may be of use to you. MailDoc.sendto = Recipient MailDoc.CopyTo = ccRecipient MailDoc.BlindCopyTo = bccRecipient Also for multiple email addresses you just set MailDoc.sendto to an array of variants each of which will receive the message. So Dim recip(25) as variant recip(0) = "emailaddress1" recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip Thanks must go out to Mark Austin, Long Beach, California assisted by the great folks at www.deja.com & www.notes.net
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kjsb$qa6$
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion : n2kis1$nmp$ Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
Dans ta question originale, tes adresses étaient dans une feuille de calcul!
Pour extraire les adresses d'un carnet d'adresses... ceci n'a pas été testé
je n'ai pas le temps!
'-----------------------------------------------
Sub Envoi_Courriel()
'Requiert la bibliothèque suivante :
'Microsoft Outlook XX.0 Object Library
'Outils / référence / et tu coches la référence
Dim Adr As String
Dim olNS As Outlook.Namespace
Dim i As ContactItem
Dim OlApp As Outlook.Application
Set OlApp = CreateObject("Outlook.Application")
Set olNS = OlApp.GetNamespace("MAPI")
Set Contacts = olNS.GetDefaultFolder(olFolderContacts)
Set Litems = Contacts.Items
On Error Resume Next ' Contacts incomplets
For Each i In Litems
If i.Email1Address <> "" Then
Adr = Adr & i.Email1Address & ";"
End If
Next
Adr = Left(Adr, Len(Adr) - 1)
With OlApp
With .CreateItem(0)
.To = Adr
.Subject = "L'objet du message"
.HTMLBody = "Le message"
'.Display ' Afficher avant d'envoyer si nécessaire
.Send
End With
End With
Application.ScreenUpdating = False
End Sub
Set OlApp = Nothing: Set Contacts = Nothing: Set Litems = Nothing
End Sub
'-----------------------------------------------
Je ne connais pas "Lotus Notes", mais tu peux débuter ta recherche par ceci
:
Ceci provient du site : http://www.fabalou.com/
'Public Sub SendNotesMail(Subject as string, attachment as string,
'recipient as string, bodytext as string,saveit as Boolean)
'This public sub will send a mail and attachment if neccessary to the
'recipient including the body text.
'Requires that notes client is installed on the system.
Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient
As String, BodyText As String, SaveIt As Boolean)
'Set up the objects required for Automation into lotus notes
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'THe current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim AttachME As Object 'The attachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
'Get the sessions username and then calculate the mail file name
'You may or may not need this as for MailDBname with some systems you
'can pass an empty string
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) -
InStr(1, UserName, " "))) & ".nsf"
'Open the mail database in notes
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
'Already open for mail
Else
Maildb.OPENMAIL
End If
'Set up the new mail document
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment,
"Attachment")
MailDoc.CREATERICHTEXTITEM ("Attachment")
End If
'Send the document
MailDoc.PostedDate=Now() 'Gets the mail to appear in the sent items
folder
MailDoc.SEND 0, Recipient
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub
If you want to send a message to more than one person or copy or blind
carbon copy the following may be of use to you.
MailDoc.sendto = Recipient
MailDoc.CopyTo = ccRecipient
MailDoc.BlindCopyTo = bccRecipient
Also for multiple email addresses you just set MailDoc.sendto to an array of
variants each of which will receive the message. So
Dim recip(25) as variant
recip(0) = "emailaddress1"
recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip
Thanks must go out to
Mark Austin, Long Beach, California
assisted by the great folks at
www.deja.com & www.notes.net
MichD
---------------------------------------------------------------
"Manu" a écrit dans le message de groupe de discussion :
n2kjsb$qa6$1@speranza.aioe.org...
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le
fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion :
n2kis1$nmp$1@speranza.aioe.org...
Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le
nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'---------------------------------------------------------
Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1")
For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row)
Adr = Adr & C.Value & ";"
Next
Adr = Left(Adr, Len(Adr) - 1)
End With
With CreateObject("Outlook.Application")
With .CreateItem(0)
.To = Adr
.Subject = "L'objet du message"
.HTMLBody = "Le message"
'.Display ' Afficher avant d'envoyer si nécessaire
.Send
End With
End With
Application.ScreenUpdating = False
End Sub
'---------------------------------------------------------
MichD
---------------------------------------------------------------
"Manu" a écrit dans le message de groupe de discussion :
n2kfup$gtt$1@speranza.aioe.org...
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible
d'envoyer un mail type à toutes mes adresses mail de la colonne E en une
seule fois.
Merci
Manu
---
L'absence de virus dans ce courrier électronique a été vérifiée par le
logiciel antivirus Avast.
https://www.avast.com/antivirus
---
L'absence de virus dans ce courrier électronique a été vérifiée par le
logiciel antivirus Avast.
https://www.avast.com/antivirus
Dans ta question originale, tes adresses étaient dans une feuille de calcul! Pour extraire les adresses d'un carnet d'adresses... ceci n'a pas été testé je n'ai pas le temps!
'----------------------------------------------- Sub Envoi_Courriel() 'Requiert la bibliothèque suivante : 'Microsoft Outlook XX.0 Object Library 'Outils / référence / et tu coches la référence Dim Adr As String Dim olNS As Outlook.Namespace Dim i As ContactItem Dim OlApp As Outlook.Application Set OlApp = CreateObject("Outlook.Application") Set olNS = OlApp.GetNamespace("MAPI") Set Contacts = olNS.GetDefaultFolder(olFolderContacts)
Set Litems = Contacts.Items
On Error Resume Next ' Contacts incomplets For Each i In Litems If i.Email1Address <> "" Then Adr = Adr & i.Email1Address & ";" End If Next Adr = Left(Adr, Len(Adr) - 1)
With OlApp With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub Set OlApp = Nothing: Set Contacts = Nothing: Set Litems = Nothing End Sub '-----------------------------------------------
Je ne connais pas "Lotus Notes", mais tu peux débuter ta recherche par ceci :
Ceci provient du site : http://www.fabalou.com/
'Public Sub SendNotesMail(Subject as string, attachment as string, 'recipient as string, bodytext as string,saveit as Boolean) 'This public sub will send a mail and attachment if neccessary to the 'recipient including the body text. 'Requires that notes client is installed on the system. Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean) 'Set up the objects required for Automation into lotus notes Dim Maildb As Object 'The mail database Dim UserName As String 'The current users notes name Dim MailDbName As String 'THe current users notes mail database name Dim MailDoc As Object 'The mail document itself Dim AttachME As Object 'The attachment richtextfile object Dim Session As Object 'The notes session Dim EmbedObj As Object 'The embedded object (Attachment) 'Start a session to notes Set Session = CreateObject("Notes.NotesSession") 'Get the sessions username and then calculate the mail file name 'You may or may not need this as for MailDBname with some systems you 'can pass an empty string UserName = Session.UserName MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf" 'Open the mail database in notes Set Maildb = Session.GETDATABASE("", MailDbName) If Maildb.ISOPEN = True Then 'Already open for mail Else Maildb.OPENMAIL End If 'Set up the new mail document Set MailDoc = Maildb.CREATEDOCUMENT MailDoc.Form = "Memo" MailDoc.sendto = Recipient MailDoc.Subject = Subject MailDoc.Body = BodyText MailDoc.SAVEMESSAGEONSEND = SaveIt 'Set up the embedded object and attachment and attach it If Attachment <> "" Then Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment") Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment") MailDoc.CREATERICHTEXTITEM ("Attachment") End If 'Send the document MailDoc.PostedDate=Now() 'Gets the mail to appear in the sent items folder MailDoc.SEND 0, Recipient 'Clean Up Set Maildb = Nothing Set MailDoc = Nothing Set AttachME = Nothing Set Session = Nothing Set EmbedObj = Nothing End Sub
If you want to send a message to more than one person or copy or blind carbon copy the following may be of use to you. MailDoc.sendto = Recipient MailDoc.CopyTo = ccRecipient MailDoc.BlindCopyTo = bccRecipient Also for multiple email addresses you just set MailDoc.sendto to an array of variants each of which will receive the message. So Dim recip(25) as variant recip(0) = "emailaddress1" recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip Thanks must go out to Mark Austin, Long Beach, California assisted by the great folks at www.deja.com & www.notes.net
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kjsb$qa6$
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion : n2kis1$nmp$ Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
Manu
Merci Beaucoup Mich
Manu
"MichD" a écrit dans le message de groupe de discussion : n2km5a$jn$
Dans ta question originale, tes adresses étaient dans une feuille de calcul! Pour extraire les adresses d'un carnet d'adresses... ceci n'a pas été testé je n'ai pas le temps!
'----------------------------------------------- Sub Envoi_Courriel() 'Requiert la bibliothèque suivante : 'Microsoft Outlook XX.0 Object Library 'Outils / référence / et tu coches la référence Dim Adr As String Dim olNS As Outlook.Namespace Dim i As ContactItem Dim OlApp As Outlook.Application Set OlApp = CreateObject("Outlook.Application") Set olNS = OlApp.GetNamespace("MAPI") Set Contacts = olNS.GetDefaultFolder(olFolderContacts)
Set Litems = Contacts.Items
On Error Resume Next ' Contacts incomplets For Each i In Litems If i.Email1Address <> "" Then Adr = Adr & i.Email1Address & ";" End If Next Adr = Left(Adr, Len(Adr) - 1)
With OlApp With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub Set OlApp = Nothing: Set Contacts = Nothing: Set Litems = Nothing End Sub '-----------------------------------------------
Je ne connais pas "Lotus Notes", mais tu peux débuter ta recherche par ceci :
Ceci provient du site : http://www.fabalou.com/
'Public Sub SendNotesMail(Subject as string, attachment as string, 'recipient as string, bodytext as string,saveit as Boolean) 'This public sub will send a mail and attachment if neccessary to the 'recipient including the body text. 'Requires that notes client is installed on the system. Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean) 'Set up the objects required for Automation into lotus notes Dim Maildb As Object 'The mail database Dim UserName As String 'The current users notes name Dim MailDbName As String 'THe current users notes mail database name Dim MailDoc As Object 'The mail document itself Dim AttachME As Object 'The attachment richtextfile object Dim Session As Object 'The notes session Dim EmbedObj As Object 'The embedded object (Attachment) 'Start a session to notes Set Session = CreateObject("Notes.NotesSession") 'Get the sessions username and then calculate the mail file name 'You may or may not need this as for MailDBname with some systems you 'can pass an empty string UserName = Session.UserName MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf" 'Open the mail database in notes Set Maildb = Session.GETDATABASE("", MailDbName) If Maildb.ISOPEN = True Then 'Already open for mail Else Maildb.OPENMAIL End If 'Set up the new mail document Set MailDoc = Maildb.CREATEDOCUMENT MailDoc.Form = "Memo" MailDoc.sendto = Recipient MailDoc.Subject = Subject MailDoc.Body = BodyText MailDoc.SAVEMESSAGEONSEND = SaveIt 'Set up the embedded object and attachment and attach it If Attachment <> "" Then Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment") Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment") MailDoc.CREATERICHTEXTITEM ("Attachment") End If 'Send the document MailDoc.PostedDate=Now() 'Gets the mail to appear in the sent items folder MailDoc.SEND 0, Recipient 'Clean Up Set Maildb = Nothing Set MailDoc = Nothing Set AttachME = Nothing Set Session = Nothing Set EmbedObj = Nothing End Sub
If you want to send a message to more than one person or copy or blind carbon copy the following may be of use to you. MailDoc.sendto = Recipient MailDoc.CopyTo = ccRecipient MailDoc.BlindCopyTo = bccRecipient Also for multiple email addresses you just set MailDoc.sendto to an array of variants each of which will receive the message. So Dim recip(25) as variant recip(0) = "emailaddress1" recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip Thanks must go out to Mark Austin, Long Beach, California assisted by the great folks at www.deja.com & www.notes.net
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kjsb$qa6$
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion : n2kis1$nmp$ Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
Merci Beaucoup Mich
Manu
"MichD" a écrit dans le message de groupe de discussion :
n2km5a$jn$1@speranza.aioe.org...
Dans ta question originale, tes adresses étaient dans une feuille de calcul!
Pour extraire les adresses d'un carnet d'adresses... ceci n'a pas été testé
je n'ai pas le temps!
'-----------------------------------------------
Sub Envoi_Courriel()
'Requiert la bibliothèque suivante :
'Microsoft Outlook XX.0 Object Library
'Outils / référence / et tu coches la référence
Dim Adr As String
Dim olNS As Outlook.Namespace
Dim i As ContactItem
Dim OlApp As Outlook.Application
Set OlApp = CreateObject("Outlook.Application")
Set olNS = OlApp.GetNamespace("MAPI")
Set Contacts = olNS.GetDefaultFolder(olFolderContacts)
Set Litems = Contacts.Items
On Error Resume Next ' Contacts incomplets
For Each i In Litems
If i.Email1Address <> "" Then
Adr = Adr & i.Email1Address & ";"
End If
Next
Adr = Left(Adr, Len(Adr) - 1)
With OlApp
With .CreateItem(0)
.To = Adr
.Subject = "L'objet du message"
.HTMLBody = "Le message"
'.Display ' Afficher avant d'envoyer si nécessaire
.Send
End With
End With
Application.ScreenUpdating = False
End Sub
Set OlApp = Nothing: Set Contacts = Nothing: Set Litems = Nothing
End Sub
'-----------------------------------------------
Je ne connais pas "Lotus Notes", mais tu peux débuter ta recherche par ceci
:
Ceci provient du site : http://www.fabalou.com/
'Public Sub SendNotesMail(Subject as string, attachment as string,
'recipient as string, bodytext as string,saveit as Boolean)
'This public sub will send a mail and attachment if neccessary to the
'recipient including the body text.
'Requires that notes client is installed on the system.
Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient
As String, BodyText As String, SaveIt As Boolean)
'Set up the objects required for Automation into lotus notes
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'THe current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim AttachME As Object 'The attachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
'Get the sessions username and then calculate the mail file name
'You may or may not need this as for MailDBname with some systems you
'can pass an empty string
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) -
InStr(1, UserName, " "))) & ".nsf"
'Open the mail database in notes
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
'Already open for mail
Else
Maildb.OPENMAIL
End If
'Set up the new mail document
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment,
"Attachment")
MailDoc.CREATERICHTEXTITEM ("Attachment")
End If
'Send the document
MailDoc.PostedDate=Now() 'Gets the mail to appear in the sent items
folder
MailDoc.SEND 0, Recipient
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub
If you want to send a message to more than one person or copy or blind
carbon copy the following may be of use to you.
MailDoc.sendto = Recipient
MailDoc.CopyTo = ccRecipient
MailDoc.BlindCopyTo = bccRecipient
Also for multiple email addresses you just set MailDoc.sendto to an array of
variants each of which will receive the message. So
Dim recip(25) as variant
recip(0) = "emailaddress1"
recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip
Thanks must go out to
Mark Austin, Long Beach, California
assisted by the great folks at
www.deja.com & www.notes.net
MichD
---------------------------------------------------------------
"Manu" a écrit dans le message de groupe de discussion :
n2kjsb$qa6$1@speranza.aioe.org...
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le
fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion :
n2kis1$nmp$1@speranza.aioe.org...
Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le
nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'---------------------------------------------------------
Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1")
For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row)
Adr = Adr & C.Value & ";"
Next
Adr = Left(Adr, Len(Adr) - 1)
End With
With CreateObject("Outlook.Application")
With .CreateItem(0)
.To = Adr
.Subject = "L'objet du message"
.HTMLBody = "Le message"
'.Display ' Afficher avant d'envoyer si nécessaire
.Send
End With
End With
Application.ScreenUpdating = False
End Sub
'---------------------------------------------------------
MichD
---------------------------------------------------------------
"Manu" a écrit dans le message de groupe de discussion :
n2kfup$gtt$1@speranza.aioe.org...
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible
d'envoyer un mail type à toutes mes adresses mail de la colonne E en une
seule fois.
Merci
Manu
---
L'absence de virus dans ce courrier électronique a été vérifiée par le
logiciel antivirus Avast.
https://www.avast.com/antivirus
---
L'absence de virus dans ce courrier électronique a été vérifiée par le
logiciel antivirus Avast.
https://www.avast.com/antivirus
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
"MichD" a écrit dans le message de groupe de discussion : n2km5a$jn$
Dans ta question originale, tes adresses étaient dans une feuille de calcul! Pour extraire les adresses d'un carnet d'adresses... ceci n'a pas été testé je n'ai pas le temps!
'----------------------------------------------- Sub Envoi_Courriel() 'Requiert la bibliothèque suivante : 'Microsoft Outlook XX.0 Object Library 'Outils / référence / et tu coches la référence Dim Adr As String Dim olNS As Outlook.Namespace Dim i As ContactItem Dim OlApp As Outlook.Application Set OlApp = CreateObject("Outlook.Application") Set olNS = OlApp.GetNamespace("MAPI") Set Contacts = olNS.GetDefaultFolder(olFolderContacts)
Set Litems = Contacts.Items
On Error Resume Next ' Contacts incomplets For Each i In Litems If i.Email1Address <> "" Then Adr = Adr & i.Email1Address & ";" End If Next Adr = Left(Adr, Len(Adr) - 1)
With OlApp With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub Set OlApp = Nothing: Set Contacts = Nothing: Set Litems = Nothing End Sub '-----------------------------------------------
Je ne connais pas "Lotus Notes", mais tu peux débuter ta recherche par ceci :
Ceci provient du site : http://www.fabalou.com/
'Public Sub SendNotesMail(Subject as string, attachment as string, 'recipient as string, bodytext as string,saveit as Boolean) 'This public sub will send a mail and attachment if neccessary to the 'recipient including the body text. 'Requires that notes client is installed on the system. Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean) 'Set up the objects required for Automation into lotus notes Dim Maildb As Object 'The mail database Dim UserName As String 'The current users notes name Dim MailDbName As String 'THe current users notes mail database name Dim MailDoc As Object 'The mail document itself Dim AttachME As Object 'The attachment richtextfile object Dim Session As Object 'The notes session Dim EmbedObj As Object 'The embedded object (Attachment) 'Start a session to notes Set Session = CreateObject("Notes.NotesSession") 'Get the sessions username and then calculate the mail file name 'You may or may not need this as for MailDBname with some systems you 'can pass an empty string UserName = Session.UserName MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf" 'Open the mail database in notes Set Maildb = Session.GETDATABASE("", MailDbName) If Maildb.ISOPEN = True Then 'Already open for mail Else Maildb.OPENMAIL End If 'Set up the new mail document Set MailDoc = Maildb.CREATEDOCUMENT MailDoc.Form = "Memo" MailDoc.sendto = Recipient MailDoc.Subject = Subject MailDoc.Body = BodyText MailDoc.SAVEMESSAGEONSEND = SaveIt 'Set up the embedded object and attachment and attach it If Attachment <> "" Then Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment") Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment") MailDoc.CREATERICHTEXTITEM ("Attachment") End If 'Send the document MailDoc.PostedDate=Now() 'Gets the mail to appear in the sent items folder MailDoc.SEND 0, Recipient 'Clean Up Set Maildb = Nothing Set MailDoc = Nothing Set AttachME = Nothing Set Session = Nothing Set EmbedObj = Nothing End Sub
If you want to send a message to more than one person or copy or blind carbon copy the following may be of use to you. MailDoc.sendto = Recipient MailDoc.CopyTo = ccRecipient MailDoc.BlindCopyTo = bccRecipient Also for multiple email addresses you just set MailDoc.sendto to an array of variants each of which will receive the message. So Dim recip(25) as variant recip(0) = "emailaddress1" recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip Thanks must go out to Mark Austin, Long Beach, California assisted by the great folks at www.deja.com & www.notes.net
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kjsb$qa6$
Merci Mich,
Après un 1er test, j'ai reçu un message comme quoi il ne trouve pas le fichier C:userstotoDocumentsFichiers OutlookOutlook.pst
et il bug bien sur sur la ligne With CreateObject("Outlook.Application")
Et est-ce possible d'envoyer avec Windows live mail et Lotus Notes ?
Manu
"MichD" a écrit dans le message de groupe de discussion : n2kis1$nmp$ Bonjour,
Vérifie auprès de ton fournisseur Internet afin de savoir le nombre d'adresses possibles pour l'envoi de courriel.
Cela ayant pour but d'empêcher les "spams"
'--------------------------------------------------------- Sub Envoyer_Courriels()
Dim Adr As String, C As Range
Application.ScreenUpdating = False
With Worksheets("Feuil1") For Each C In .Range("A1:A" & .Range("A" & .Rows.Count).End(xlUp).Row) Adr = Adr & C.Value & ";" Next Adr = Left(Adr, Len(Adr) - 1) End With
With CreateObject("Outlook.Application")
With .CreateItem(0) .To = Adr .Subject = "L'objet du message" .HTMLBody = "Le message" '.Display ' Afficher avant d'envoyer si nécessaire .Send End With End With Application.ScreenUpdating = False End Sub '---------------------------------------------------------
MichD --------------------------------------------------------------- "Manu" a écrit dans le message de groupe de discussion : n2kfup$gtt$
Bonjour,
J'ai dans une BDD en colonne E des adresses mails, est t'il possible d'envoyer un mail type à toutes mes adresses mail de la colonne E en une seule fois.
Merci
Manu
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus
--- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus