Send An Automated Email To Typed In Email Address
May 20, 2008
I am trying to send an automated email by use of a "email" button. What I want it to do is to pop up a input box that will ask me who I want to send the email to, and once I hit ok it will send open up outlook and send the email. I have the code to work if I want it to be sent to a specific email address, but I can't seem to get the email address entry part to work. I will attach my code as it lays right now.
Private Sub CommandButton2_Click()'Need to reference: Microsoft Forms 2.0 Object LibrarySet OutApp = CreateObject("Outlook.Application")OutApp.Session.LogonSet OutMail = OutApp.CreateItem(0)strbody = "This is the most up to date copy of EAS Tracking 2.0 as well as the Resource Planning Sheet."attachmnt2 = "C:My DocumentsResource Planning Sheet_External.xls"On Error Resume Next'?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|? BELOW IS WHERE I CAN'T GET TO WORK!!!With OutMailDim range As Longrange = Application.InputBox("How many copies do you want?", "Number of Copies").To = range.Subject = "This Weeks Reports".Body = strbody.Attachments.Add (attachmnt2).Display.SaveEnd With'__________________________________________________attachmnt3 = "C:My DocumentsReport DataWork Request Tracking Data FolderEAS Request 2.0.xls"On Error Resume NextWith OutMail.Subject = "This Weeks Reports".Body = strbody.Attachments.Add (attachmnt3).Display.SaveEnd .........
View 9 Replies
ADVERTISEMENT
Apr 29, 2014
I have specified the email addresses in the code to whom the email will be sent when the user presses "Send Email" button but now I want to add all the addresses in the Access table and write down the code that will send an email to those people whose addresses are in the Access table.
[Code] .....
View 5 Replies
View Related
Jul 16, 2014
I have an excel sheet where automatically live data comes in.
When the cells reach a certain value the value in cell R1 becomes 1.
I want to make a macro in vba that sends me ONE email if the value becomes 1.
I tried :
Public Function MailS(mailtrigger As Double) As Double
If mailtrigger = 1 Then
Call makeandsendemail
Application.Run "makeandsendemail"
MailS = 1
Else
MailS = 1
End If
End Function
But this code send millions of emails.
View 9 Replies
View Related
Oct 15, 2009
The following line of code is part of the great work that this forum did in creating a macro to send an automated email through Lotus Notes.
I have a small tweak that requires the Body of the message to exist on sheet other than the one where the macro is launched.
The originial code had:
Body1 = Replace(Join(Application.Transpose(Range([by9], [by18].End(3))), "@") & "@@Thank you,", "@", vbCrLf)
I tried:
Body1 = Replace(Join(Application.Transpose(Sheets("LookUp Sheet").Range([by9], [by18].End(3))), "@") & "@@Thank you,", "@", vbCrLf)
But the body of the email is not being copied.
Am I putting the calling the Sheets reference incorrectly?
The routine works perfectly if the body data comes from the sheet where the macro is launched?
View 9 Replies
View Related
Sep 12, 2012
Here is a code line that works
.To = "giordano.bruno@gmail.com"
The following is passed over by the code, but does not send an email
.To = Recip
Recip is a variable taken from a cell value and, when I hover the cursor over it, shows "giordano.bruno@gmail.com" complete with inverted commas.
View 2 Replies
View Related
Jan 22, 2013
I have a template invoice in excel. What I want is a macro code that when it is run the open template invoice should be sent to a specific email address !!
View 5 Replies
View Related
May 17, 2013
I have a form in excel (very simple) that I need to put on the web - People can then fill out certiain bits of the information and the idea is that they then click on the button to email it back to me. Ie complete it there and then and email it straight away so that they don't need to save it etc.
I can't for the life of me work out how to do this! I've managed to get the macro to open an email with the correct details on but not paste in the information so am at a complete loss and appear to be going round in circles!
View 2 Replies
View Related
Apr 15, 2014
Is it possible for a Macro to read a cell say D:11 and copy that email address and send the active sheet to that email?
View 9 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
Oct 13, 2009
I am using the following code and it works great the only problem is that when I have more then one email address in the same cell it will not send the email. Even if I seperate it with a semicolon. It work fine if I have just one email address in the email field. How can I get it to send the same info to different email addresses.
View 4 Replies
View Related
Jan 2, 2013
I have created a user Form where a user can enter all the details like (First name, last name, Email ID etc...). the entered data is submitted on Sheet1 and it is working for me.
Now which I want is the is it possible to pick up the last email id (Column D) and send an automatic email where email will be sent the last recipient?
Actually I want is that when a user will fill up the form I want to send him/her an email.
View 8 Replies
View Related
Jul 3, 2013
I have the below code to email a specific sheet to an email address, however the email stays in the outbox and isn't sent. Is there something missing from the code or is it a setting issue with my email? I'm using Outlook 2010.
[Code]....
View 1 Replies
View Related
Oct 18, 2006
I need to email a page from a worksheet to a series of people and am currently using the following
Worksheets("Report").Activate
ActiveWorkbook.Save
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application. ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
however, I also need the worksheet to be email to the person currently running the macro (i.e. when they email it to the others, a copy is sent to thier own inbox too), is there any way in which this can be done?
The user's email address could be formed from data in the spreadsheet, if there is an easier way to do this (i.e. email address is based on a cell in the spreadsheet).
View 3 Replies
View Related
Feb 23, 2010
I have search on this forum regarding sending email on excel using outlook email application. I would like to ask if is it possible to use other email applications like AOL when sending email thru excel? I have attached a sample workbook.
View 9 Replies
View Related
Mar 12, 2014
If a cell changes to true i want it to send an email to the address that is in another cell,
For example if F5 CHANGES to true then send email to address in G5,
From here i can add in the subject line, and body i just cant figure out how to get it to send to a specific email address based on the cell value, and also only do it once, when it changes to TRUE rather than everytime the sheet is active, so i would require a macro to constantly be running, or run of off the cell when it changes
View 1 Replies
View Related
Sep 7, 2009
I have a spreadsheet that deals with expiration dates. The whole sheet is conditional formatted so that when the current date is within 3days of the date showing in A2 then that cell changes colors. Ok is it possible that a script can be written so that when the cell changes colors... (Someone is going to think I am silly asking this but) excel sends an automated Email?
View 2 Replies
View Related
Jul 18, 2013
Making an excel program that will automatically Email 5 people with either the whole document, a link to the doc, or just an email using the cells to inform them on what needs to be checked. And I don't even know where to start.
There will be a spreadsheet with everyone's name going down in column A, and then in the row next to the name it'll have a date of when they were put on it. It'll then have another date of the time they need to have done certain things, like see the doctor or get a class done, so when the current date reaches the date in the column the cell that is the same date will turn red, and the document will be mailed to 5 of the higher ups to inform them they need to check on this Marine to see if he has accomplished whatever task has expired.
Ive been trying to research a lot of this on my own, but ran into problem where the current outlook version does not suppose the command DATE within an excel, so I need to make a database using multiple excel sheets using Visual Basic(or so I'm told now).
View 1 Replies
View Related
Sep 7, 2008
I used Scheduled Task to set up my spreadsheet to open daily. I have the code with assistance to pull out the due date items and place them into an email.
I have come across XLSTART/AUTOEXEC/ACTIVATE...ETC...
But cannot figure out the code that will automatically "enabling macro" once Scheduled Task opens the spreadsheet?
Then once the macro runs, the email with the due dates, how can this auto send without user interaction?
(currently I would have to hit send)
I am trying to make the process totally automated to open the spreadsheet at a certain time, send the email with due dates and close the spreadsheet.
Following code in ThisWorkbook--
Private Sub Workbook_Open()
Check_Date_Send_Mail
End Sub
Code in Module1--
Option Explicit
Sub Check_Date_Send_Mail()
Dim wbBook As Workbook
Dim wsSheet As Worksheet
Dim rnDate As Range, rnValue As Range
Dim stAddress As String, stMsg As String
Dim stRecipient As String, stSubject As String
Dim stPost As String
Set wbBook = ThisWorkbook
Set wsSheet = wbBook.Worksheets("Sheet1")
With wsSheet
Set rnDate = .Range("d2:t23")
End With
View 9 Replies
View Related
Dec 19, 2006
it has been designed to send out automated emails using Excel and Lotus Notes, unfortunately the code was give to me to modify and the person who created it didn't comment the code at all so i'm finding it impossible to see what each part is doing: ....
View 14 Replies
View Related
May 22, 2014
I am struggling to find a macro which can look at a name in column 'BT' and search it in the address book of Outlook to then place the email address of that person in column 'ED'
There are 35,000+ people in the address book and there may be over 5 email addresses for one name, so is there any way a message can appear for the user to select which email address is correct if there is more than 1 contact for that name?
View 1 Replies
View Related
Feb 25, 2014
On a worksheet called "Contact Info" column A starting in row 2 I have a list of names (variable length). In Columns B2-D I need the email address, work phone number, and cell phone number.
View 5 Replies
View Related
Aug 12, 2009
I have a problem sending email thru excel, if i use this =HYPERLINK(CONCATENATE("mailto:",B2,"?subject=",C3,"&body=",D4),"Send e-mail") <-- this is working, but i want my body to also include not just d4, i tried to put name d4:g7 as body so the code would be: =HYPERLINK(CONCATENATE("mailto:",B2,"?subject=",C3,"&body=",body),"Send e-mail") <<-- the problem is this is not working ,
View 4 Replies
View Related
Jul 30, 2014
I'm trying to program a send e-mail botton and everything is working well. However I would like to change the send to address from a specific cell to a if than statement.
I would like it to read along the lines of........ if "I5" = yes then copy cell from "M5"
[Code] .....
View 1 Replies
View Related
Mar 20, 2014
I'm trying to send a basic email using example [URL]..... but just cannot get it to work.
Here's my code and the error I get is "Run-time error '-2147220978 (8004020e)': The server rejected the sender address. The server response was: 530 5.7.1 Client was not authenticated."
I found my smtp server by looking in Outlook properties so I know that's right and for all instances of "person@email.com" I am putting my email address and the password is the normal password I use to log on.
View 1 Replies
View Related
Jan 5, 2010
I'm running a Ron DeBruin's mail routine to copy and send a spreadsheet. The code I'm using is below. The problem is the source spreadsheet contains cells with more than 255 characters, and so that information is being truncated when the sheet is copied. I'm sure there's any easy fix for this, but I haven't been able to find it. Here's my code:
View 3 Replies
View Related
May 4, 2009
I feel like I almost have the Excel button I need (thanks to an exhaustive forum search), but I have 2 problems that I need help to correct. First, the code works fine if I have one email address in my Email column, but If I add a second or third email in my column, the code sends the mail, but bounces back because of an Invalid Internet address specified error. The response looks to me like it is taking the first address and appending to the second email recipient. An example would be <example@example.com,example>@example.com. Here is the code I am using:
View 3 Replies
View Related
May 8, 2009
I have the code that saves it a a PDF, but a nicety would be to email it as well: -
inputfileSaveName = Application.GetSaveAsFilename(fileFilter:="PDF Files (*.pdf), *.pdf")
'export it - works just fine!
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=filesavename, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
'OK up to here!
Application.Dialogs(xlDialogSendMail).Show arg1:="", _
arg2:=EmailTitle, arg3:=Receipt
It now sends the "workbook" as an attachment and not the PDF..
How do I remove the attachment and attach the PDF Ive just created?
View 3 Replies
View Related
Apr 15, 2013
I have a macro currently using the activeworkbook.sendmail command to send out an email using LOTUS NOTES with the workbook as an attachment. Unfortunately, the code appears to only support putting recipients in the TO field. I need to be able to also add additional recipients under the CC field.
View 1 Replies
View Related
Jan 6, 2008
i need to do is send an email via excel. In previous practice I have used the Activeworkbook.send method, but in this instance I dont want to send an attachment, all I need to do is send an email to someone, making use of the to: cc:subject and main body text fields.
View 9 Replies
View Related
Mar 26, 2009
I have found the below mentioned code from one of the threads.
Sub EmailDoc()
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olMail As MailItem
Set olMail = olApp.CreateItem(olMailItem)
Application.ScreenUpdating = False
With olMail
.To = Range("A1").value
.SentOnBehalfOfName = """xyz"" "
.Subject = "Resources"
'.Attachments.Add "D: estxyz.xls"
.send
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
The above code works fine but i want to send emails to all the names in my column A in the To field and in the CC field from column D (It shoulds send if there are any values for the CC field)
View 9 Replies
View Related