Sendmail Without Attachments
Mar 23, 2007
Is there a way to use the function Sendmail without sending the Workbook, sheets or any attachments at all. I just would like to push a button in my Workbook so that a mail goes to the recipient saying for example: "Check our shared folder.
View 4 Replies
ADVERTISEMENT
Apr 8, 2009
I have the below code,
But i want to adapt the "ActiveWorkbook.Sendmail" so I can attach my current workbook as it is, to the email.
Private Sub CommandButton10_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "you@email.com"
.CC = "me@email.com"
.BCC = ""
.Subject = "Testing send to multiple emails."
.Body = "Please review." & vbCrLf & vbCrLf & ActiveWorkbook.FullName
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Dim Msg, Style, Title
Msg = "E-mail has been sent " & Chr(13) & Chr(10) & "Press OK to continue."
Style = vbOKOnly + vbInformation
Title = "Open Issues List"
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
End Sub
View 9 Replies
View Related
Sep 15, 2007
I am using a sendmail macro I found online. I cannot remember where I found it or who wrote it.
I need to change it so that it references a cell (HTOM!C2) for the email instead of a static address. The portion I need to change is 14 lines up from the bottom.
Option Explicit ....
View 7 Replies
View Related
Mar 19, 2012
I have the below code of which I would like to addresses added to the CC list Also, Would it possible to add a range as the body? E.G:
.CCaddress = "somebody@mail.com"
.CCaddress ="somebody.else@mail.com"
Body text = Range("A1"& "" &"B1")
Code that need the above inputted:
With ActiveWorkbook
.SendMail Recipients:=Array("steve.howard@kuehne-nagel.com"), _
Subject:="610 Cambridge " & Format(Date, "yyyymmdd") & " " & "Counts"
[add cc address + body]
.Close SaveChanges:=False
End With
View 5 Replies
View Related
Dec 2, 2008
I am trying to attatch an excel document to a post on this fums but it wont work.
View 5 Replies
View Related
Feb 2, 2007
Column A has a list of companies, column B-G has email addresses for each company (some companies have just one email, others may have four) Column H has the name of a report I would like to send to each company (It is a different file for each company)
I would like to loop through each row and send one email that includes all the contacts and the attachment.
I manipulated some code that is pretty much what I want it to do, but not quite. The below code looks like it is looking for email adresses (I don't really need that feature) and is sending an email to each address versus each company.
Sub Send_Files()
'Working in 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim sh As Worksheet
Dim cell As Range, FileCell As Range, rng As Range
With Application
.EnableEvents = False
.ScreenUpdating = False
End With.........
View 9 Replies
View Related
Jun 20, 2007
What would be disabled that is preventing me from adding attachments to my posts? I click on the paperclip and the button "Manage Attachments". Nothing happens.
View 6 Replies
View Related
Aug 22, 2007
I am trying write one to search a range of cells and attach all files located in those cells to an email. I can get most of the code to work, but am having difficult getting it to search through specific cells.
View 14 Replies
View Related
Apr 5, 2012
I'm having some troubles sending email as attachments from Excel using VBA where my workbooks have the XLSX name. I am getting the following message instead of the email with attachments:
FILE QUARANTINED
The original contents of this file have been replaced with this message because of its characteristics.
File name: 'winmail.dat'
Virus name: 'ScanTimeExceeded'
When I change the file extension to xls it is fine - I get the attachments on the email.
Here is my VBA:
With oLookMail
'.To = "busmgrs2@uwc.edu"
'.CC = "finspec2@uwc.edu"
.To = msToRecip
.Subject = "Accounts Status Reports as of " & msAsOfDate
.Body = "Attached are the AR Monthly Reports"
.Attachments.Add "citpfile07usoffAccounts ReceivableAR Monthly Report 2004-05.xlsx"
[Code]....
View 4 Replies
View Related
Oct 25, 2012
I have a scrip that i use to safe email attachments that works and is as follow.
Code:
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
[Code]....
Now the problem is that the email comes with 2 excel email attachments and i only want to save the one that has a name + date stamp.
View 2 Replies
View Related
Mar 14, 2014
this macro works perfectly when I only have one attachment per email. I thought this part of the code would solve my problem however it is now not attaching any files where I want more than one attachment.
VB:
Dim files As Variant, file As Variant
files = Split(filepath, ",")
For Each file In files
.attachments.Add file
wing in the cells in column B (where I need more than one attachment):
G:DocumentsReportsAJ - 6C091, 6C0922. Feb 6C091 Cost Centre Report.xls,02. Feb 6C092 Cost Centre Report.xls
G:DocumentsReportsAJ - 6C091, 6C0922. Feb 6C091 Cost Centre Report.xls,G:DocumentsReportsAJ - 6C091, 6C0922. Feb 6C092 Cost Centre Report.xls
Full code below....
VB:
Sub Send_Emails()
i = Cells(2, "B").Value
Do ' start[code]...
View 2 Replies
View Related
Aug 16, 2012
MY VBA code failed and sucks---
I have a Excel spreadsheet with codes, names, and emails then I have a folder that have XML files with codes that should match and be sent via Outlook 2007 as an attachment.
Example:
Excel sheet
PHA Code
First
Last
email
ALxx2
Jon
Smith
Jon Smith@xyz.com
[code]....
XML files reside in the following folder:
C:UsershomecomputerDesktopTESTxml files
ALxx2_06122012.xml
ALxy10_06122012.xml
ALzz12_06122012.xml
BTW- I have about 3,000 emails to send.
View 7 Replies
View Related
Jul 2, 2013
Everyday a report is emailed to me as an attachment in .pdf and .xlsx format. It is always sent to me from the same address and comes at around the same time every day.
I already have another macro that uses that report to update our records with the new info in the report and then email our records to my boss. I would like to make it easier for other people who also get the report emailed to them to run the macro. To do so I would like to amend the macro I have to check for the email in whoever is running the macro's inbox and download only the .xlsx file and save it to the correct location.
I have tried messing with the restrict method. I want to make this thing fool proof. (Ex. if the email isn't in yet, return a msg box informing as such.)
The code for the macro I already have can be found below. Confidential stuff has been redacted.
Code:
Sub PartThree()
'This macro does the following:
'1.) runs the MTD.template.xls module 2
View 2 Replies
View Related
Jun 12, 2014
Getting attachments from outlook subfolders.
My attachments are in Inbox > First subfolder (sales) > second subfolder(Sales 1)
I need to save attachments from second subfolder (Sales 1) to my drive.
Currently i got macro which picks up attachments from first subfolder (Sales). The macro code is
Sub SaveAttachmentsToFolder()
On Error GoTo SaveAttachmentsToFolder_err
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim SubFolder As MAPIFolder
[Code] ...........
View 2 Replies
View Related
Apr 20, 2006
I am trying to write a VBA application within Excel to go through all Lotus Notes e-mails in a specific directory and save the attachment to a specific directory, remove the attachment and insert text into the e-mail in the spot the attachment was located that states "The attachment has been removed".
I'd also like to insert a 1KB text file into the e-mail that would be called "File Removed.txt" that would still allow you to quickly find the e-mails that had attachments because the little paperclip would show up.
View 3 Replies
View Related
Jul 23, 2014
I have a macro to send emails to a group people that based on various criteria, it will attach a number of files to a recipient's particular email. This is a small portion of the code that does the attachment adding:
Code:
If Range("B" & a) = "Y" Then
If citChev "" Then .Attachments.Add citChev
End If
If Range("C" & a) = "Y" Then
If citMits "" Then .Attachments.Add citMits
End If
If Range("D" & a) = "Y" Then
If citToyo "" Then .Attachments.Add citToyo
End If
If Range("E" & a) = "Y" Then
[code].....
Most people get several of the files attached to their email and all works fine. But, there are certain conditions when all the IF() stmts fail where a recipient will not get any files attached. I do not want to send the email if this is the case, but it currently is sending it.
Is there a way after all the IF() stmts have processed to check to see if this current email has any attachments assigned to it? (IF .Attachments "" Then...) does not work.
View 2 Replies
View Related