Dear all,
Is anyone know how to send a mail to someone when there is new record being
added into a table ??
Am i suppose to use trigger ?? how to use it ??
Thanks.
Lee, MY
Is anyone know how to send a mail to someone when there is new record being
added into a table ??
Am i suppose to use trigger ?? how to use it ??
Thanks.
Lee, MY
Neil Pike MVP/MCSE. Protech Computing LtdQuote:> Is anyone know how to send a mail to someone when there is new record being
> added into a table ??
> Am i suppose to use trigger ?? how to use it ??
Neil,Quote:> Lee - yes, use a trigger and call xp_cmdshell from it. There are examples
of
> triggers in the BOL
Why xp_cmdshell?
Surely xp_sendmail would be more use if he wants to send mail, or are you
hiding a secret somewhere?
J.T.
Neil Pike MVP/MCSE. Protech Computing LtdQuote:> Surely xp_sendmail would be more use if he wants to send mail, or are you
> hiding a secret somewhere?
SMTP is simpler. how would you do it using SMTP, apart from using a
com object?
> > Surely xp_sendmail would be more use if he wants to send mail, or
are you
> > hiding a secret somewhere?
> Neil Pike MVP/MCSE. Protech Computing Ltd
> (Please reply only to newsgroups)
> For SQL FAQ entries see
> or www.ntfaq.com/sql.html (+ ntfaq download)
> or http://www.swynk.com/faq/sql/sqlserverfaq.asp
> or http://www.sql-server.co.uk
Ahah, yet another opportunity to gratuitously advertise my xp:Quote:> xp_sendmail will require ms exchange, and also a profile set up on the
> machine, right?
> SMTP is simpler. how would you do it using SMTP, apart from using a
> com object?
Neil may be back in a minute to give very precise instructions as to how you
can get xp_sendmail to work via SMTP, but in my experience any configuration
is flaky at best (eventually it'll hang).
It's also possible to use xp_sendmail via NT's PostOffice, but generally
that's utterly useless 'cos noone uses it.
Which leaves sending SMTP via some other method.
You can do it via COM (indeed, the code that is used in my SMTP xp was
originally in a COM object), but controlling COM objects via SQL is ugly,
error prone (i.e. the error handling facilities are minimal) and hard to
maintain.
So I rewrote my COM object as an XP.
If you wait until later today I should be uploading a newer version.
J.T.
It requires the MAPI api on the SQL Server machine. This is installed with a
number of mail clients (outlook, for instance). Thos mail clients generally
have drivers (providers) for a _number_ of mail servers, including SMTP.
--
Tibor Karaszi
MCDBA, MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB
Please reply to the newsgroup only, not by email.
> SMTP is simpler. how would you do it using SMTP, apart from using a
> com object?
> > JT - nope, just a typo. xp_sendmail would be the thing!
> > > Surely xp_sendmail would be more use if he wants to send mail, or
> are you
> > > hiding a secret somewhere?
> > Neil Pike MVP/MCSE. Protech Computing Ltd
> > (Please reply only to newsgroups)
> > For SQL FAQ entries see
> > or www.ntfaq.com/sql.html (+ ntfaq download)
> > or http://www.swynk.com/faq/sql/sqlserverfaq.asp
> > or http://www.sql-server.co.uk
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Hi freinds,
Is it possible to settle some how that SQL server send email as a record
added to a table?
I have to say that sql mail is working fine.
Thank you in advance ,
Patrick
2. Need help: Better to migrate from NT 4.0/SQL 7.0 to Windows 2000/SQL 7.0 or SQL 2000?, pcumming
3. FM4/web sending mail when new record is created
5. Auto E-mail Notification of new record
7. adding new records & new record
9. to get a lot of records of mail addresses from SQL 6.5 to mail server
10. Someone is Blocking IIUG E-Mail (Informix-List)
11. Has someone written a e-mail interface with Ingres ESQL/C
12. to get a lot of records of mail addresses from SQL 6.5 to mail server