Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 7th, 2009, 07:41 PM
Daniel Shiel Daniel Shiel is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 19 Daniel Shiel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 56 sec
Reputation Power: 0
VB - Set CC as Sender

This is probably a very simple answer but i am yet to find it.

I have a button on my main form that generates an email with the details within the record.

The whoTo is set to our customer service inbox (works fine), however i would like to have the cc set to the person who is submitting the email so that they have a copy also.

And yes the simple solution is for the person to look in their sent folder, however half of these people wouldn't know where it is.

Any help would be much appreciated.

Thanks.

Reply With Quote
  #2  
Old October 8th, 2009, 05:18 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
Hi,

Any chance you can post your code so we can see how you are sending the email as I think the syntax for adding a cc would depend upon the technique that you are using to send the email.

In the meantime, if you wanted to send an email to the customer at the same time you could just add them as a recipient at the same time by seperating the addresses with semi-colons, eg:
Code:
ObjSendMail.To = "tech_support@my_company.com ; " & strCustEmail

Reply With Quote
  #3  
Old October 8th, 2009, 05:23 PM
Daniel Shiel Daniel Shiel is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 19 Daniel Shiel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 56 sec
Reputation Power: 0
Some of the code isn't working properly. When fields are empty i get an invalid use of null error and haven't been able to come up with the fix for this yet either.
Code:
Private Sub img_ConfirmEscalation_Click()

On Error GoTo Err_img_ConfirmEscalation_Click

Dim stDocName As String
Dim whoTo As String
Dim cc As String
    
whoTo = "customer.service"

Dim FeedbackNumber As String
Dim InjuredWorker As String
Dim ClaimNumber As String
Dim DueDate As Date

Dim FeedbackFrom As String
Dim ContactNumber As String
Dim MainCategory As String
Dim SubCategory As String
Dim Reason As String

Dim FeedbackDescription As String

Dim theSubject As String
Dim theMessage As String

'If Me.fld_FeedbackFrom.Value = "" Then
'FeedbackFrom = "N/A"
'Else: FeedbackFrom = Me.fld_FeedbackFrom.Value
'End If

'If Me.fld_ContactNumber.Value = IsNull Then
'ContactNumber = ""
'Else: ContactNumber = Me.fld_ContactNumber.Value
'End If

'If Me.fld_MainCategory.Value = IsNull Then
'MainCategory = ""
'Else: MainCategory = Me.fld_MainCategory.Value
'End If

'If Me.fld_SubCategory.Value = Null Then
'SubCategory = ""
'Else: SubCategory = Me.fld_SubCategory.Value
'End If

'If Me.fld_Reason.Value = Null Then
'Reason = ""
'Else: Reason = Me.fld_Reason.Value
'End If

'If Me.fld_FeedbackDescription.Value = Null Then
'FeedbackDescription = ""
'Else: FeedbackDescription = Me.fld_FeedbackDescription.Value
'End If

FeedbackNumber = Me.fld_FeedbackNumber.Value
ClaimNumber = Me.fld_ClaimNumber.Value
DueDate = Me.fld_DueDate.Value

ContactNumber = Me.fld_ContactNumber.Value
FeedbackFrom = Me.fld_FeedbackFrom.Value
MainCategory = Me.fld_MainCategory.Value
SubCategory = Me.fld_SubCategory.Value
Reason = Me.fld_Reason.Value

theSubject = "Customer Feedback Number: " & FeedbackNumber & " Claim Number: " & ClaimNumber & " Due Date: " & DueDate
theMessage = "Contact Person: " & Me.fld_FeedbackFrom.Value & Chr(13) & Chr(13) & _
             "Contact Number: " & Me.fld_ContactNumber.Value & Chr(13) & Chr(13) & _
             "Main Category: " & Me.fld_MainCategory.Value & Chr(13) & Chr(13) & _
             "Sub Category: " & Me.fld_SubCategory.Value & Chr(13) & Chr(13) & _
             "Reason: " & Me.fld_Reason.Value & Chr(13) & Chr(13) & _
             "Feedback Description: " & Me.fld_FeedbackDescription.Value & Chr(13) & Chr(13)
             
If MsgBox("Are you sure you want to escalate this Feedback?", vbYesNo + vbQuestion, "") = vbYes Then
    
    DoCmd.SendObject acSendNoObject, , , whoTo, cc, , theSubject, theMessage, True
    
Else
    DoCmd.CancelEvent

End If

Exit_img_ConfirmEscalation_Click:
    
Exit Sub

Err_img_ConfirmEscalation_Click:
    MsgBox Err.description
    Resume Exit_img_ConfirmEscalation_Click
    
End Sub

Last edited by sync_or_swim : October 9th, 2009 at 04:02 AM. Reason: Please use code tags when posting code

Reply With Quote
  #4  
Old October 9th, 2009, 04:06 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
With regards the IsNull issue, the syntax is IsNull([field name]), try something like this:
Code:
If Not IsNull(Me.fld_FeedbackFrom.Value) Then
	FeedbackFrom = Me.fld_FeedbackFrom.Value
Else 
	FeedbackFrom = "N/A"
End If

With regards the cc, I'm afraid I'm not familiar with the syntax you are using so my only suggestion would be to simply concatenate the customer service address with the sender's address using a semi-colon, this will send the email to both recipients. Maybe someone else has a better suggestion.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB - Set CC as Sender


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek