activeworkbook.sendmail help

stevedhawes

Board Regular
Joined
Sep 11, 2007
Messages
112
Hi all,

I am using the activeworkbook.sendmail command, and would like to include a cell value in the subject line.

For example

Subject line would equal "quote" & cell.value A1 & "has been approved"

also, would like to know how to enter some text in the body of this email via code.

Grateful for any help
Steve
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

hatman

Well-known Member
Joined
Apr 8, 2005
Messages
2,664
To change the subject, simply assign a value to that argument:

Code:
ThisWorkbook.SendMail "user@domain", "quote " & Range("A1").Value & " has been approved"

This method does not allow the Body Text to be set programmatically. You can omit the address argument, which will caus ethe E-Mail window to be displayed, forcing the user to supply the Address in the proper field, which has the side-effect of allowing body text to be typed in before manually hitting send.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,912
Messages
5,598,828
Members
414,260
Latest member
joishe

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
Top