December 11, 2005 at 1:01 pm
Can some one please inform me on how to send email? Like if a new use signs up i would like to send their new email and useid and a welcome letter....
What is the easyest way to do this... so that i do not get to lost...
thanks,
erik..
Dam again!
December 11, 2005 at 5:44 pm
The best way to do this would be to have an application that looks at the user table and sends emails or is triggered when they initially sign in. Alternatively, you could use SQLMail or smtp mail from SQL Server, which I wouldn't recommend. If you determine to go this route though, search the articles section of either this site or http://www.sqlteam.com for "mail". You will pull up several articles on how to setup and use.
Derrick Leggett
Mean Old DBA
When life gives you a lemon, fire the DBA.
December 11, 2005 at 10:40 pm
For sending the email to your users. There are a lot of methods, components for that.
I am giving my method by considering some server related stuffs
Server OS :win2k or win2003(CDOSYS.dll installed)
Technology used : ASP
By using CDOSYS you can send emails without spending a single rupee. If you go for components then you need to prequire the components and spend for installing that in the server( If it is shared hosting they ask installation fees ranges from 25 to 50$). But these problems are not in the CDO SYS.
Below is the code for ASP with CDOSYS
<%
' send by connecting to port 25 of the SMTP server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost
Const cdoSendUsingPort = 2
StrSmartHost = "mail.example.com"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing"😉 = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver"😉 = strSmartHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"😉 = 10
.Update
End With
' build HTML for message body
strHTML = ""
strHTML = strHTML & ""
strHTML = strHTML & ""
strHTML = strHTML & " This is the test HTML message body"
strHTML = strHTML & ""
strHTML = strHTML & ""
' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = "nrnoble@example.com"
.From = "nrnoble@example.com"
.Subject = "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = strHTML
.Send
End With
' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
%>
Change the needed feilds to yours and this will run. The orginal code is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_clb_sending_smtp_mail_by_port_25_using_cdosys_vbs.asp
If you are using PHP then PHP has inbuilt Mailing methods (PHPMail and SMTPMail) plese check the documents of PHP at http://www.php.net
I belive this code is useful to you. You can also view my website http://www.bepenfriends.com a free online dating web site for more details(used these free features there)
thank you
Albert Arul prakash
December 12, 2005 at 12:10 am
i get this error.. This error is all over the net... and i have configured the outlook more than once and still get this same when i try to test the email in the sqlserveragent. However, i am able to send myself email through the test part of sql.. ( ON THE STEP JOBS dialog box) in the agent jobs part...... but the mail session is not acting correctly..
erik..
[260] Unable to start mail session (reason: Unable to logon (reason: MapiLogonEx Failed due to MAPI error 87: Invalid parameter); check the mail profile and/or the SQLSERVERAGENT service startup account)
any suggestions?
Dam again!
December 12, 2005 at 7:45 am
When ever creating jobs and sending the resuly via email.... sql just simples uses the outlook to do this.... i can sent a test mail fine however when i try to set the SqlserverMailAgent is not running..... hummmm well ok,,,,,
did every thing but take the tires off....and still nothing...;. need the sql help here people...
sos..
erik....
Dam again!
December 12, 2005 at 8:01 pm
Sorry friends, I thought he is asking in programming so only i gave my asp codes.
Albert
wanna have a free dating today.
December 21, 2005 at 7:47 am
Give this link a try...I have tried SQLMail and Cdonts but found this to work the best for me.
http://www.sqldev.net/xp/xpsmtp.htm
This has worked very well for me.
December 22, 2005 at 7:14 am
Need some help...
i am receiving this error when tring to run the procedure..
Server: Msg 8145, Level 16, State 2, Procedure xp_smtp_sendmail, Line 0
@ping is not a parameter for procedure xp_smtp_sendmail.
thanks,
erik.
Dam again!
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply