Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
etietje
Starting Member
24 Posts |
Posted - 2004-02-26 : 09:38:51
|
| Hi everybody. I am trying to write a DTS package that sends an email to our users based on different situations. The tricky part for me is that some of the emails need to look like they came from person A and others need to come from person B. Is there a way to change the "from" line and/or the "reply to" fields using ActiveX vbscript?I could also use xp_sendmail from Sql Server if there is a way to do this using that system stored proc.Thanks :) |
|
|
claire
Starting Member
19 Posts |
Posted - 2004-02-26 : 10:53:53
|
| Try some logic like this vbs, by passing different value to "a" you could get different sender, receiver, subject, textbody, attachement,.....everything!!Set objNewMail = CreateObject("CDO.Message")set objArgs=WScript.Argumentsa = objArgs(0)if a = 1 thenobjNewMail.Sender = "adhakjdhsakjdhgkajf@hotmail.com"objNewMail.To = "swswssww@auyeiquwe.com"objNewMail.Subject = "Subject1"objNewMail.TextBody = "eqiuekfjshaflkjahasdkjnfsaklfjhlaksjfhvklwjq"objNewMail.Send Set objNewMail = NOTHINGend ifif a=2 then objNewMail.Sender = "eqyuioeyeqeo@hotmail.com"objNewMail.To = "zazazaz@hahahahahaha.xxx"objNewMail.Subject = "Subject2"objNewMail.TextBody = "dusalruywo iuryeljrehfjkhf"objNewMail.Send Set objNewMail = NOTHINGend if |
 |
|
|
sphadke
Yak Posting Veteran
55 Posts |
Posted - 2004-02-26 : 13:09:30
|
| you could use xp_sendmail but the from part of the email will be the SQL Mail account. I don't think that can be changed.Sachin |
 |
|
|
|
|
|