Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Create a scheduled task to email from SQL Expand / Collapse
Author
Message
Posted Tuesday, October 21, 2008 10:58 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
Log in to the SQL Server's Outlook client & mailbox yourself on the Server and try to set your defaults that way.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #589310
Posted Wednesday, October 22, 2008 3:15 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, October 15, 2013 4:05 AM
Points: 554, Visits: 114
You can send emails without outlook just with cdosys. Take a look at How to send e-mail without using SQL Mail in SQL Server http://support.microsoft.com/kb/312839/en-us

Regards Ramon
Post #589674
Posted Wednesday, October 22, 2008 11:10 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 01, 2010 5:45 AM
Points: 19, Visits: 73
Yeah I think i will stick to the xp_sendmail function for now as it seems to be a bit quicker and easier to use. Will defo read up on it tho.

Cheers!!

With the code below
EXEC master.dbo.xp_sendmail
@recipients = N'',
@query = N'EXEC RPT_3_Daily ''21-oct-2008''',
@subject = N'UK1428',
@message = N'Please find new information attached.',
@attach_results = 'TRUE',
@width = 250,
@separator = ',',
@no_header = 'TRUE',
@attachments = 'New.csv'

the attachment I receive doesn't sit in the columns properly, I have opened the file up using notepad++ which displays a lot of "NULL" values when the stored procedure to be run contains characters as well as numerics in the results, however if I use the same code as above and use a stored procedure that will only produce numbers then the csv displays fine and even opens in excel, is there something else that I have missed off to allow the file produced display and organise the alphanumeric characters correctly within excel?
Post #589972
Posted Wednesday, October 22, 2008 12:20 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
This is probably caused by commas in your string-based columns. You will need to put quotation marks around the columns that might have commas embedded in their text. Alternatively, use a different separator character (like TAB) that you are sure will not be in any of the columns.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #590031
Posted Monday, November 10, 2008 2:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, January 28, 2011 9:02 AM
Points: 37, Visits: 36
Hi,


I want to send mail's from sql ,

eg: Consider table as Table1 , with 1 column as modifiedon, When the modifiedon date is greated than 2 days of last modified date than mail has to be automatically sent to users.

In google i read this can be done in SQLMAil,

Can you please give me details steps to do this.


Thanks in Advance,
Archana
Post #599689
Posted Monday, November 10, 2008 4:38 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
You can find this in BOL(Books Online). If you still need help, then please start a new topic.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #600297
Posted Tuesday, November 11, 2008 1:25 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 01, 2010 5:45 AM
Points: 19, Visits: 73
cheers for the help, will have a play and let you know the outcome.

thanks again
Post #600460
Posted Tuesday, November 11, 2008 7:15 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
Glad we could help.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #600646
Posted Monday, December 01, 2008 10:30 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 01, 2010 5:45 AM
Points: 19, Visits: 73
Hi Guys,

back already!!!!!

Right.... i got the xp_sendmail function working and have started to have a play with the CDONTs functions which to my surprise I have managed to do and send a HTML bodied email from the SQL server without requiring Outlook to be installed on it, now to be a complete pain:

I want to be able to send the results from a working stored procedure as various attachments to this pretty HTML email that CDONTs produces. I have been able to send SP's as attachments using the xp_sendmail function which seems pretty straight forward but would like to use the CDONTs now as it seems like a more powerful way. The formats that I want to be able to attach are 1 SP to a csv file and 1 SP to a pdf file. They don't necessarily have to be on the same email but also is that possible?

thanks again for all your previous help and thanks in advance for the help to follow!!!
:D
Post #611490
Posted Monday, December 01, 2008 11:44 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
This is a different question. You should start a new topic.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #611559
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse