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.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Send Mail Task using Expressions

Author  Topic 

notes4we
Yak Posting Veteran

90 Posts

Posted - 2008-10-13 : 16:57:42
I have build two user defined variables that get the TO and FROM email ids from a SQL Server Table using a SQL Query. Those variables have the data stored.

TO Variable: EmailTOVariable
FROM Variabnle: EmailFROMVariable

When I am trying to use these variables in the Send Mail Task, I was able to successfully go to the Send Mail Task Editor, Expressions Option and then I have these two User Defined Variables as my expressions.

FromLine - @[User::EmailTOVariable]
ToLine - @[User::EmailFROMVariable]

But now when I go to the Mail tab in the same window, I am not able to understand what should I write in From and To there?
I tried putting these variable names, but it is showing error and I tried few other ways, but none of those is working.

I would appreciate if anyone of you could help me know this last step in what I am doing. I just want to know what should I put in the From and To line so that I get the data from these variables (that are mentioned in the expressions tab also).

Thank you.

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-10-14 : 07:21:35
No need to enter any value on the 'To' and 'From', Mail section. In fact, once you define it from expression 'FromLine' and 'ToLine', it will appear automatically.
Go to Top of Page

notes4we
Yak Posting Veteran

90 Posts

Posted - 2008-10-14 : 08:19:07
Hello,

Thank you for your reply.

I kept the To and From blank but I am getting an error that No recipient in specified and if I mention that variable, then I get an error that "The adress in the From line is malformed. It is either missing the @ symbol or is not valid.

Do you have any other suggestions that I can try?
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-10-14 : 08:27:15
Under Expressions, do you see these parameter/values?

FromLine - @[User::EmailTOVariable]
ToLine - @[User::EmailFROMVariable]

Also, just to make sure do you see its variable value when you hit Evaluate Expression?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-14 : 08:32:44
Also cn you check if you've declared values in correct scope. this can be done by opening the variables window and checking scope against the above two variables.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-14 : 08:32:45
Also cn you check if you've declared values in correct scope. this can be done by opening the variables window and checking scope against the above two variables.
Go to Top of Page

notes4we
Yak Posting Veteran

90 Posts

Posted - 2008-10-14 : 10:10:23
Hi,

I found out the problem.
Everything else was fine in my package (Variable, Scope everything).
But, we need to leave the To and From field blank, but set the DelayValidation to True, not False.
After I set it to True, then I was able to get the error messages.

Thank you.
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-10-14 : 10:20:03
Great job notes4we!
Go to Top of Page

chinni22
Starting Member

1 Post

Posted - 2009-10-03 : 18:40:17
Anyone please help on this

[Send Mail Task] Warning: The address in the "To" line is malformed. It is either missing the "@" symbol or is not valid.

vijaya kumar
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-05 : 14:22:38
have you given a valid email in to field? does value come from variable? if yes, put a breakpoint before this task and see if it has the expected value
Go to Top of Page
   

- Advertisement -