send-mail macro: no mail is sent if one's inbox is full!!!

bogumil

New Member
Joined
Nov 3, 2005
Messages
2
Hi.
I wrote this macro in order to send an excel file as attachment to more recipients:

Sub Send_Mail_Array()
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim wbname As String
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
wbname = "C:/" & "Attached File" & " " & _
Format(Now, "dd-mm-yy hh-mm-ss") & ".xls"
wb1.SaveCopyAs wbname
Set wb2 = Workbooks.Open(wbname)
With wb2

Response = MsgBox("an attached file will be sent to these recipients: XXX, YYY, ZZZ. Are you sure you want to go on?", vbYesNo + vbExclamation)

If Response = vbNo Then


ElseIf Response = vbYes Then
.sendmail Array("XXX@mail.com", "YYY@mail.com", "ZZZ@mail.com")
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False

ddhtd = MsgBox("Mails have been sent!", vbInformation + vbOKOnly)


End If

End With
Application.ScreenUpdating = True
End Sub

******

The problem is that: if just one of the recipients has exceeded the capacity of the inbox and the mail addressed to him/her fail, emails cannot reach the other recipients - result: no email sent at all...How can I correct my macro?

Thanx in advance
Bogumil
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,203,125
Messages
6,053,655
Members
444,676
Latest member
locapoca

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top