Send automated and scheduled emails in SQL Express

Поділитися
Вставка
  • Опубліковано 3 лис 2024

КОМЕНТАРІ • 33

  • @datafriendly
    @datafriendly  2 роки тому

    Procedure for account creation:
    EXECUTE msdb.dbo.sysmail_add_account_sp
    @account_name = 'Email',
    @description = 'Sent Mail using MSDB localhost',
    @email_address = 'your@email.com',
    @display_name = 'Name',
    @username='your@email.com',
    @password='xxxxxxxxxxxxxxx',
    @mailserver_name = 'outlook.office365.com',
    @port = '587',
    @enable_ssl = 1

    EXECUTE msdb.dbo.sysmail_add_profile_sp
    @profile_name = 'Email',
    @description = 'Profile used to send mail'
    EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
    @profile_name = 'Email',
    @account_name = 'Email',
    @sequence_number = 1
    EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
    @profile_name = 'Email',
    @principal_name = 'public',
    @is_default = 1 ;
    SELECT * FROM msdb.dbo.sysmail_log
    GO

    • @in-litedesign4391
      @in-litedesign4391 2 роки тому

      Could you please show the CREATE PROCEDURE Code as well.

  • @gambu4810
    @gambu4810 2 роки тому

    A good teacher doesn't say, I've already executed that part. He actually shows the execution and every step of the lesson. Thank you so much good Sir, however.

    • @datafriendly
      @datafriendly  2 роки тому +1

      Glad it was helpful! There is a script for that part in the pinned comment.

  • @luke2042
    @luke2042 Рік тому

    Very nice. Thank you.

  • @sambhunathchakraborty
    @sambhunathchakraborty Рік тому +1

    superb..........BOSS

  • @ukaszbinkowski2197
    @ukaszbinkowski2197 2 роки тому +1

    Thank you so much for this video , You helped me so much at my work !!!!!

  • @amrselim2167
    @amrselim2167 Рік тому

    Great man

  • @akshaykumarng3013
    @akshaykumarng3013 Рік тому

    Nice 👍

  • @anu8419
    @anu8419 Рік тому

    Thankyou so much for this video...it's really very helpful...could you please tell instead of table, if i use stored procedure , so how to declare variables in the query for stored procedure

  • @Harziona
    @Harziona 3 роки тому

    Thanks so much for sharing. It's really helpful

  • @xenias1509
    @xenias1509 3 роки тому

    Great Information! If I had a schedule my SQL job every 15 min, 'if exist' then send an email. But I want to receive the email once with the same row, is there any way to manage it? Something like if it was sent before then don't send...I got the same email every 15 min..it's distracting. Thank you in advance.

    • @datafriendly
      @datafriendly  3 роки тому

      Hi, I haven't done this yet, so I'm not sure about that. I'll let you know once I find how to do that.

  • @loveofkaranpreetha9317
    @loveofkaranpreetha9317 2 роки тому +1

    one doubt on the above video
    you explained everythink but one think you forgot which is how to create procedure for creating account,profile,..
    if you see my comments could you please share that sp

    • @datafriendly
      @datafriendly  2 роки тому

      Here you go:
      EXECUTE msdb.dbo.sysmail_add_account_sp
      @account_name = 'Email',
      @description = 'Sent Mail using MSDB localhost',
      @email_address = 'your@email.com',
      @display_name = 'Name',
      @username='your@email.com',
      @password='xxxxxxxxxxxxxxx',
      @mailserver_name = 'outlook.office365.com',
      @port = '587',
      @enable_ssl = 1
      EXECUTE msdb.dbo.sysmail_add_profile_sp
      @profile_name = 'Email',
      @description = 'Profile used to send mail'
      EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
      @profile_name = 'Email',
      @account_name = 'Email',
      @sequence_number = 1
      EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
      @profile_name = 'Email',
      @principal_name = 'public',
      @is_default = 1 ;
      SELECT * FROM msdb.dbo.sysmail_log
      GO

    • @in-litedesign4391
      @in-litedesign4391 2 роки тому

      @@datafriendly Hey did you get the CREATE SP code?

    • @in-litedesign4391
      @in-litedesign4391 2 роки тому

      did you get that code?

  • @Mihaihunter
    @Mihaihunter 2 роки тому

    I have a question. I cannot see the table on my outlook window. I tried to uncheck the message format options that removed the format of messages. Still not working. Any ideea why i still see the html code?

    • @datafriendly
      @datafriendly  2 роки тому

      Might be the issue with your e-mail client. Or some mistake in the code itself.

  • @napathelu
    @napathelu Рік тому

    Is is possible to do the same in Oracl sQL developer

  • @PhươngThảoNguyễn-b1b
    @PhươngThảoNguyễn-b1b Рік тому

    How to send the procedure result via email?

    • @datafriendly
      @datafriendly  Рік тому

      It was mentioned in the video, please take a look again.

  • @osnlearn8034
    @osnlearn8034 Рік тому

    lets go to the gym and doin martial art. learn islam go to mosque, change your habit,and become human as ALLAH want it. become expert programmer or anything else for Allah. dont be perfect. just calm down and always pray to Allah.

  • @kihramcizadegiller
    @kihramcizadegiller Рік тому

    i always get an error.. database mail settings true.
    The mail could not be sent to the recipients because of the mail server failure.
    (Sending Mail using Account 11 (2023-09-13T13:10:15). Exception Message: Cannot send mails to mail server. (Failure sending mail.)

  • @ammarfaqih6919
    @ammarfaqih6919 2 роки тому

    Please explain how to send a voucher or voucher to a customer via WhatsApp from SqlServer

    • @datafriendly
      @datafriendly  2 роки тому

      Sorry, but my channel is crypto oriented now, I don't make videos about SQL anymore.